Index of /doc/docutils-doc

[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory  -  
[TXT]BUGS.html2017-01-19 10:46 13K 
[TXT]BUGS.txt2014-07-07 04:36 9.5K 
[TXT]FAQ.html2017-01-19 10:46 67K 
[TXT]FAQ.txt2016-02-26 22:40 44K 
[TXT]HISTORY.html2017-01-19 10:46 155K 
[TXT]HISTORY.txt2016-12-09 10:48 111K 
[   ]NEWS.Debian.gz2017-01-19 10:46 351  
[TXT]README.html2017-01-19 10:46 20K 
[TXT]README.txt2017-01-19 10:46 12K 
[TXT]RELEASE-NOTES.html2017-01-19 10:46 28K 
[TXT]RELEASE-NOTES.txt2016-12-09 10:48 17K 
[TXT]THANKS.html2017-01-19 10:46 5.4K 
[TXT]THANKS.txt2015-02-09 00:21 3.1K 
[   ]changelog2016-12-09 10:48 111K 
[   ]changelog.Debian.gz2017-01-19 10:46 13K 
[   ]copyright2017-01-19 10:46 17K 
[DIR]css/2017-08-25 16:43 -  
[DIR]docs/2017-01-19 10:46 -  

README: Docutils 0.12

README: Docutils 0.12

Author: David Goodger
Date: 2014-07-07
Web site:
Copyright: This document has been placed in the public domain.


Quick-Start on Debian systems

The reStructuredText tools are installed in the normal system path by the Debian python-docutils package. To convert reStructuredText to another format, use a shell command like:

rst2html /usr/share/doc/python-docutils/FAQ.txt ./FAQ.html

See Usage below for details.

Quick-Start on other systems

This is for those who want to get up & running quickly.

  1. Docutils requires Python (version 2.4 or later), available from

    See Requirements below for details.

  2. Use the latest Docutils code. Get the code from the Subversion repository or from the snapshot:

    See Releases & Snapshots below for details.

  3. Unpack the tarball in a temporary directory (not directly in Python's site-packages), go to the directory created by expanding the archive, and run install with admin rights. On Windows systems it may be sufficient to double-click

    See Installation below for details.

  4. Use the front-end scripts to convert reStructuredText documents. Try for example: FAQ.txt FAQ.html         (Unix)
    python tools/ FAQ.txt FAQ.html  (Windows)

    See Usage below for details.


The purpose of the Docutils project is to create a set of tools for processing plaintext documentation into useful formats, such as HTML, XML, and LaTeX. Support for the following sources has been implemented:

Support for the following sources is planned:

Releases & Snapshots

While we are trying to follow a "release early & often" policy, features are added very frequently. Since the code in the Subversion repository is usually in a bug-free state, we recommend that you use the current snapshot (which is usually updated within an hour of changes being committed to the repository):

To keep up to date on the latest developments, download fresh copies of the snapshots regularly or use a working copy of the Subversion repository.


To run the code, Python must be installed. Docutils is compatible with Python versions from 2.4 up to 2.7 and versions 3.1 and 3.2 (cf. Python 3 compatibility).

Docutils uses the following packages for enhanced functionality, if they are installed:

Python 3 compatibility

The Docutils codebase is written for Python 2 and uses "on-demand" translation for porting to Python 3.

  • The script generates Python 3 compatible sources in build/ and tests in tests3/ sub-directories during installation with Python 3.
  • The scripts in the tools/ sub-directory work with all supported Python versions without conversion.
  • To convert the sources without installing (e.g. for testing), run python3 build.
  • When editing the source, do changes on the Python 2 versions of the files and re-run the build command.

Using Docutils with Python 3.x is less tested and might still have some issues.

Project Files & Directories

Generated directories when installing under Python 3:


The first step is to expand the .tgz archive in a temporary directory (not directly in Python's site-packages). It contains a distutils setup file "". OS-specific installation instructions follow.

GNU/Linux, BSDs, Unix, Mac OS X, etc.

  1. Open a shell.

  2. Go to the directory created by expanding the archive:

    cd <archive_directory_path>
  3. Install the package (you may need root permissions to complete this step):

    (enter admin password)
    python install

    If the python executable isn't on your path, you'll have to specify the complete path, such as /usr/local/bin/python.

    To install for a specific Python version, use this version in the setup call, e.g.

    python3.1 install

    To install for different Python versions, repeat step 3 for every required version. The last installed version will be used in the shebang line of the rst2*.py wrapper scripts.


Just double-click If this doesn't work, try the following:

  1. Open a DOS Box (Command Shell, MS-DOS Prompt, or whatever they're calling it these days).

  2. Go to the directory created by expanding the archive:

    cd <archive_directory_path>
  3. Install the package:

    <path_to_python.exe>\python install

    To install for a specific python version, specify the Python executable for this version.

    To install for different Python versions, repeat step 3 for every required version.

Optional steps:


There are many front-end tools in the unpacked "tools" subdirectory. Installation under Unix places copies in the PATH. You may want to begin with the "" front-end tool. Most tools take up to two arguments, the source path and destination path, with STDIN and STDOUT being the defaults. Use the "--help" option to the front-end tools for details on options and arguments. See Docutils Front-End Tools (docs/user/tools.txt) for full documentation.

On a Debian system the included tools (with the exception of and the development tools in the dev/ directory) are installed into the normal system path, so you can run with a command like:

rst2html example.txt example.html

The package modules are continually growing and evolving. The docutils.statemachine module is usable independently. It contains extensive inline documentation (in reStructuredText format of course).

Contributions are welcome!

Converting the documentation

After unpacking and installing the Docutils package, the following shell commands will generate HTML for all included documentation:

cd <archive_directory_path>/tools
./ ../

On Windows systems, type:

cd <archive_directory_path>\tools
python ..

The final directory name of the <archive_directory_path> is "docutils" for snapshots. For official releases, the directory may be called "docutils-X.Y.Z", where "X.Y.Z" is the release version. Alternatively:

cd <archive_directory_path>
tools/ --config=tools/docutils.conf          (Unix)
python tools\ --config=tools\docutils.conf   (Windows)

Some files may generate system messages (warnings and errors). The docs/user/rst/demo.txt file (under the archive directory) contains five intentional errors. (They test the error reporting mechanism!)

Running the Test Suite

The test suite is documented in Docutils Testing (docs/dev/testing.txt).

To run the entire test suite, open a shell and use the following commands:

cd <archive_directory_path>/test

Under Windows, type:

cd <archive_directory_path>\test

For testing with Python 3 use the converted test suite:

cd <archive_directory_path>/test3

You should see a long line of periods, one for each test, and then a summary like this:

Ran 1111 tests in 24.653s

Elapsed time: 26.189 seconds

The number of tests will grow over time, and the times reported will depend on the computer running the tests. The difference between the two times represents the time required to set up the tests (import modules, create data structures, etc.).

If any of the tests fail, please open a bug report, send email, or post a message via the web interface (see Bugs). Please include all relevant output, information about your operating system, Python version, and Docutils version. To see the Docutils version, use one of the rst2* front ends or tools/ with the --version option, e.g.:

cd ../tools
./ --version

Windows users type these commands:

cd ..\tools
python --version

Getting Help

If you have questions or need assistance with Docutils or reStructuredText, please post a message to the Docutils-users mailing list.