Actions: | Security

AllGoodBits.org

Navigation: Home | Services | Tools | Articles | Other

Simple Formatting with ReStructured Text

I want a markup language with the following characteristics:

The output formats I care most about are (X)HTML and PDF.

ReStructuredText from the docutils project seems to fit quite well. I have had better results with ReST than with my admittedly rather cursory flirtation with some of the major alternatives such as Markdown, Textile and mediawiki. I have nothing against those other projects, they are quite useful, but my personal preference has been for RestructuredText.

The Quick Reference and Jiri Barton's online renderer are my two most useful tools.

The content for this article was generated using docutils, using a template that only outputs the contents of the body tag since the rest is created by my Dancer-based webapp.

The template:

%(body)s

Generate the html:

rst2html.py --initial-header-level=3 --template=./rst_template.txt

I also use: