1

Section Parsing the Document of The Docutils Hacker's Guide mentions the quicktest.py utility that can be used to print a node tree representation of a parsed reStructuredText document. However I can't find quicktest.py anywhere in my docutils distribution installed in /usr/lib/python2.7/dist-packages/docutils. Is there other way to print the document tree?

vitaut
  • 49,672
  • 25
  • 199
  • 336
  • 1
    The quicktest.py script is included in the latest snapshot tarball from http://docutils.sourceforge.net/. But it does not get installed when you install docutils (run setup.py). I don't know why. Anyway, the source is here: https://sourceforge.net/p/docutils/code/HEAD/tree/trunk/docutils/tools/quicktest.py. – mzjn Dec 27 '13 at 14:30

1 Answers1

2

As pointed out by @mzjn the quicktest.py script is available at https://sourceforge.net/p/docutils/code/HEAD/tree/trunk/docutils/tools/quicktest.py

A document tree can also be printed as follows:

from docutils.core import publish_string
print publish_string(rst)

where rst is a string containing reStructuredText to be processed.

vitaut
  • 49,672
  • 25
  • 199
  • 336