Learning RST

One way to build skills in RST is to install docutils and use the rst2html.py script to parse an RST document and convert it to HTML pages. A simple practice document can easily show us the various RST features.

All of a project's requirements, architecture, and documentation can be written using RST and transformed into HTML or LaTeX. It's relatively inexpensive to write user stories in RST and drop those files into a directory that can be organized and reorganized, since stories are groomed, put into development, and implemented. More complex tools may not be any more valuable than docutils.

The advantage of using pure text files and the RST markup is that we can easily manage our documentation in parallel with our source code. We're not using a proprietary word processing file format. We're not using a wordy and long-winded HTML or XML markup that must be compressed to be practical. We're simply storing more text along with the source code.

If we're using RST to create the documentation, we can also use the rst2latex.py script to create a .tex file that we can run through a LaTeX toolset to create postscript or PDF documents. This requires a LaTeX toolset, and usually, the TeXLive distribution is used for this. Refer to http://www.tug.org/texlive/ for a comprehensive set of tools to transform TeX into elegant, final documents. TeXLive includes the pdfTeX tool, which can be used to convert the LaTeX output to a PDF file.

 In the next section, we'll see how to write effective docstrings.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset