Gregwar/RST Sandbox

Reference to HoHo

Note:
This is a testing sandbox, if you want to understand how it works, have a look to the rst original file

1) Titles

1) Using titles

Titles can be wrote using the underlining, the default order is:

  1. =======
  2. -------
  3. ~~~~~~~
  4. *******

2) Using auto-numbering

This is not a standard of RST but is really useful, you can use the special syntax # followed by the letter of the title you are in (it resets the counter when used).

You can for instance use Question #* if you are under an *******, the number displayed will be auto-incremented:

Question #*

The first question

Question #*

The second question

This can of course also be used to number parts, chapter etc.

3) Separator

A separator is like a title underline but without any text above:

-----

This will result in a text separation:


2) Inline style

You can force a line break by adding an extra space at the end of a line

3) Tables

Tables can be created using the line separator ====:

================     ================
**First column**     **Other column**
================     ================
Second row with      Second row, of the
some contents text   other column
============         ================

Will result in:

First columnOther column
Second row with some contents textSecond row, of the other column

Another example:

Col ACol BCol C
Col XCol YCol Z
Col UCol JCol K

4) Lists

Lists can be ordered or unordered, and nested, for instance this:

* Element A
    * Sub A, this a
      multiline sentence in the source
        1. Sub ordered as "1"
        2. Sub ordered as "2"
    * Sub hello two
* Element B

While result in:

5) Blocks

1) Quoting

You can quote a block by indenting it:

This is a normal pagagraph

    This is a quote

Will result in:

This is a normal paragraph

This is a quote

2) Code

You can quote code the same way as quote, but using the :: at the end of the previous paragraph:

Here is a piece of code:

.. code-block:: php

    <?php

    echo "I love RST";

Will result in:

Here is a piece of code:

<?php

echo "I love RST";

6) Links

1) Standard links

Links can be defined once for all using the trailing _, like this:

PHP_ is a great language

.. _PHP: http://php.net/

Will result in:

PHP is a great language

2) Anonymous links

Anonymous links can also be used to avoid copying the name just after the block that uses it, for instance:

I love GitHub__

.. __: http://www.github.com/

Will result in:

I love GitHub

You can use the following shortcut:

I love GitHub__

__ http://www.github.com/

3) Inline links

You can also define the link target inside the link:

Do you know `Google <http://www.google.com>`_ ?

Will result in:

Do you know Google ?

4) Anchor links

An anchor can be used like this:

.. _anchor:

Some anchor section, you can link to it like `this <#anchor>`_

Will result in:

Some anchor section, you can link to it like this

7) Directives

1) Include

You can include a file with the include pseudo-directive:

.. include:: file.rst

2) Replace

You can use the replace directive like this:

.. |name| replace:: bob

Hello |name| !

Will result in:

Hello bob !

3) Image

The image directive can be used to display images, this way:

.. image:: rst.png
    :width: 250px
    :title: RST logo

Will result in: