This page contains a few examples of using RestructuredText a.k.a. ReST, which can be used when posting a comment on this website.
Headers
Headers are marked by placing a line of equal-signs underneath the header text. The line should be at least as long as the text itself.
| ReST: | Result: |
|---|---|
This is header text
===================
This line should be empty
This is body text.
|
This is header textThis is body text. |
Links
A link can be done in two ways. The simplest way is to simply type the entire URL, including the http:// at the beginnnig.
If you want some text that's clickable, you have to put the text between backticks and end it with an underscore `like this`_. Then you'll have to enter the URL which it has to link to in a special way. I'll show you in an example.
| ReST: | Result: |
|---|---|
A link to http://stuvel.eu/ |
A link to http://stuvel.eu/ |
A link to `Stüvel IT`_.
This line should be empty
.. _`Stüvel IT`: http://stuvel.eu/ |
A link to Stüvel IT. |
Code
Prefix a piece of code with a double colon and an empty line, then ident the code, just like this:
| ReST: | Result: |
|---|---|
Here is some funky code::
This line should be empty
if a > b:
return False
return True
This line should be empty
Here the text continues
::Those colons mark the start of code
This line should be empty
import rsa
print rsa.gen_prime(256)
This line should be empty |
Here is some funky code: if a > b:
return False
return True
Here the text continues import rsa
print rsa.gen_prime(256)
|
As you can see, blocks of code must start and end with an empty line.
Lists
Lists are easy. Just mark every item with a star, and make sure it's indented a bit:
| ReST: | Result: |
|---|---|
A nice list:
This line should be empty
* Item 1
* Item 2
* Item 3 |
A nice list:
|