Create a parser:: parser = () Several optional arguments may be passed to modify the parser’s behavior. Please see. reStructuredText (RST, ReST, or reST) is a file format for textual data used primarily in the Python programming language community for technical documentation. It is part of the Docutils project of the Python Doc-SIG ( Documentation. RST is a file format formely created by Python community to write documentation (and so, is part of Docutils). RST files are simple text files with lightweight syntax.

Author: Akinoramar Tojat
Country: Netherlands
Language: English (Spanish)
Genre: Literature
Published (Last): 2 November 2007
Pages: 263
PDF File Size: 4.86 Mb
ePub File Size: 11.16 Mb
ISBN: 972-3-30277-921-8
Downloads: 95736
Price: Free* [*Free Regsitration Required]
Uploader: Doular

These are “one-off” hyperlinks. No markup processing is done within a literal block.

Source code for docutils.parsers.rst

Discovering those gems is left as an exercise for the reader. This directive is provided for test purposes only. Inline markup start-strings must start a text block or be immediately preceded by whitespace, one of the ASCII characters -: For example, here are three references to titles describing a tag: The default is 1.

Matches are case-sensitive but forgiving; if no exact match is found, a case-insensitive comparison is attempted. See reStructuredText Directives for details.

The backslash will disappear from the processed document. If an external hyperlink target’s URI contains an underscore as its last character, it must be escaped to avoid being mistaken for an indirect hyperlink target:.


The arguments, separated by spaces, can be: Inline internal targets are the equivalent of explicit internal hyperlink targetsbut may appear within running text. One, optional formal language.

Blank lines are used to separate paragraphs and other elements. Sidebars are like miniature, parallel documents that occur inside other documents, providing related or reference material.


Thus, you may soon find Docutils’ abilities to be insufficient for these purposes. There may be no blank line between a term line and a definition block this distinguishes definition lists from block quotes.

The ” replace ” directive has been implemented.

Several constructs begin with rwt marker, and the body of the construct must be indented relative to the marker. Such directives must verify substitution definition context, typically using code like this:: The “table” directive is used to associate a title with a table or specify options, e. The proc is meant to be used in online environments without access to a meaningful filesystem, and therefore rst include like directives won’t work. Must contain a flat field list.

This is useful for relative URIs where the address or file name is also the desired reference text:. You can make up your own admonition too. Blank lines are permitted within simple tables.

Combined with prefixthis may be used doccutils force the right numbering for a document split over several source files. Converts the argument into an integer. Returns the merged and sorted indices into a single HTML block which can be further embedded into nimdoc templates. Backslash-escapes may be necessary to prevent unintended parsing.


Option listsfor listing command-line options:. Note that any separating punctuation in the example, a period, “. If no base role is explicitly specified, a generic custom role is automatically used.

Newlines and whitespace will be preserved.

— docutils documentation

Doctest Blocks Doctree element: As with external hyperlink targetsthe link block of an indirect hyperlink target may begin on the same line as the explicit markup start or the next line. Examples of nested enumerated lists: The specific behavior depends upon the browser or focutils software used. For example, this input: Even the text in Texas is big.

Any unescaped whitespace is removed whitespace is permitted to allow for line wrapping. Incidentally, I’m really excited about reST. A line block ends with a blank line. Raw data can also be read from an external file, specified in a directive option. System messages are inserted where target links have been removed.

Block quotes consist of indented body elements: To have a block quote follow a list or any indented construct, insert an unindented empty comment in-between. This text is parsed as an enumerated list item: