reST Wiki mode, was [Doc-SIG] Suggestions for reST "modes"

David Goodger dgoodger@bigfoot.com
Tue, 07 Aug 2001 00:57:41 -0400


on 2001-08-06 9:47 PM, Garth T Kidd (garth@deadlybloodyserious.com) wrote:
> David, it just occurred to me that [most? all?] directives should simply
> be parsed and embedded in the output for the application to handle.

Depends on the directive. Directives themselves are a reStructuredText
invention. For example, I'm thinking of a set of "admonition" directives.
You could write::

    .. Caution:: Mad scientist at work!

And that would resolve to this parser output (XMLish)::

    <caution><paragraph>Mad scientist at work!</paragraph></caution>

How the directive parses its text block is up to the directive. In the
"caution" case above, the text block is parsed as usual, recognizing
body elements such as paragraphs. Another directive might include its
block as a literal block, insert up a named file and process further,
run a program, or do something else. This has to be handled in the
parser context, so the directive has access to the services of the
parser itself.

For directives which require further processing later on, the
"directive" element could be used; it which can contain any body
elements. This is how unrecognized directives will be handled.

-- 
David Goodger    dgoodger@bigfoot.com    Open-source projects:
 - Python Docstring Processing System: http://docstring.sourceforge.net
 - reStructuredText: http://structuredtext.sourceforge.net
 - The Go Tools Project: http://gotools.sourceforge.net