Share this page

Learn X in Y minutes

Where X=restructured text (RST)

RST is a file format formely created by Python community to write documentation (and so, is part of Docutils).

RST files are simple text files with lightweight syntax (comparing to HTML).

Installation

To use Restructured Text, you will have to install Python and the docutils package.

docutils can be installed using the commandline:

$ easy_install docutils

If your system has pip, you can use it too:

$ pip install docutils

File syntax

A simple example of the file syntax:

.. Lines starting with two dots are special commands. But if no command can be found, the line is considered as a comment

=========================================================
Main titles are written using equals signs over and under
=========================================================

Note that there must be as many equals signs as title characters.

Title are underlined with equals signs too
==========================================

Subtitles with dashes
---------------------

And sub-subtitles with tildes

You can put text in italic or in bold, you can “mark” text as code with double backquote :print()“.

Lists are as simple as in Markdown:

or

Tables are really easy to write:

=========== ======== Country Capital =========== ======== France Paris Japan Tokyo =========== ========

More complex tabless can be done easily (merged columns and/or rows) but I suggest you to read the complete doc for this :)

There are multiple ways to make links:

.. _Github https://github.com/

## How to Use It

RST comes with docutils where you have `rst2html`, for example:

```bash
$ rst2html myfile.rst output.html

Note : On some systems the command could be rst2html.py

But there are more complex applications that use the RST format:

Readings


Got a suggestion? A correction, perhaps? Open an Issue on the Github Repo, or make a pull request yourself!

Originally contributed by DamienVGN, and updated by 4 contributor(s).