Module Expr Str Import alias Import alias Import alias ImportFrom alias identifier ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias alias ImportFrom alias alias ImportFrom alias ImportFrom alias alias alias alias ImportFrom alias ImportFrom alias alias identifier ImportFrom alias alias identifier ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias Assign NameStore TupleLoad Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Assign NameStore TupleLoad Str Str Str Str Str Assign NameStore ListLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore BinOpAdd NameLoad ListLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call NameLoad TupleLoad NameLoad NameLoad Assign NameStore Call NameLoad TupleLoad NameLoad NameLoad NameLoad Assign NameStore Call NameLoad TupleLoad NameLoad NameLoad NameLoad Assign NameStore TupleLoad Str NameLoad NameLoad NameLoad Assign NameStore TupleLoad Str NameLoad NameLoad NameLoad Assign NameStore TupleLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr Str attr Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr Str attr Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr Str attr Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr Str attr Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr Str attr Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr Str attr Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr Str attr Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr Str attr Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr Str attr FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign SubscriptStore NameLoad Index Str NameStore SubscriptLoad NameLoad Index Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad TryExcept body Expr Call AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr NameLoad Assign NameStore Call NameLoad keyword NameLoad keyword NameLoad keyword AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr keyword NameLoad handlers ExceptHandler type NameLoad name NameStore body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMod Str TupleLoad NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad Return ListLoad NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad Call AttributeLoad NameLoad attr attr Str NameLoad attr Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad keyword Str Return ListLoad NameLoad decorator_list Assign AttributeStore NameLoad attr TupleLoad Num Num NameLoad Assign AttributeStore NameLoad attr Dict Str Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults body Expr Str If NameLoad body Assign NameStore SubscriptLoad NameLoad Index Num orelse Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr Str BinOpMod Str NameLoad keyword Str Return ListLoad NameLoad decorator_list Assign AttributeStore NameLoad attr TupleLoad Num Num NameLoad Assign AttributeStore NameLoad attr Dict Str AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore NameLoad Assign NameStore NameLoad ClassDef bases NameLoad body Expr Str Assign NameStore Num Assign NameStore Num Assign NameStore NameLoad Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam defaults Dict body If UnaryOpNot AttributeLoad NameLoad attr body Return ListLoad If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Num attr attr Str orelse Assign NameStore ListLoad Assign NameStore BoolOpOr NameLoad Str Assign NameStore ListLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore NameLoad For NameStore NameLoad body If CompareIn NameLoad NameLoad body Expr Call NameLoad SubscriptLoad NameLoad Index NameLoad Continue Assign NameStore NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad Call AttributeLoad NameLoad attr attr Str attr If UnaryOpNot NameLoad body Continue If Call AttributeLoad NameLoad attr Str body Assign NameStore SubscriptLoad NameLoad Slice Num Continue If Call AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad Str attr Call AttributeLoad Call AttributeLoad SubscriptLoad NameLoad Slice Num attr attr Assign NameStore Str Assign NameStore NameLoad orelse If Call AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad Str attr Call AttributeLoad Call AttributeLoad SubscriptLoad NameLoad Slice Num attr attr Assign NameStore Str Assign NameStore NameLoad orelse If CompareIn Str NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str Num If CompareEq Call NameLoad NameLoad Num body Assign TupleStore NameStore NameStore NameLoad orelse Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore Str Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr attr If BoolOpAnd CompareEq NameLoad Str CompareNotIn Str NameLoad body Assign NameStore BinOpMod Str TupleLoad NameLoad NameLoad orelse Assign NameStore Call AttributeLoad Str attr Call AttributeLoad Call AttributeLoad Call AttributeLoad NameLoad attr Str Str attr attr orelse Assign NameStore Call AttributeLoad Str attr Call AttributeLoad Call AttributeLoad NameLoad attr attr Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr If CompareIn Str NameLoad body Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr Str Num Index Num Assign NameStore BinOpMod Str TupleLoad Call AttributeLoad NameLoad attr NameLoad orelse Assign NameStore NameLoad Assign NameStore BinOpMod Str TupleLoad NameLoad NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore NameLoad Index NameLoad NameLoad Expr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr If UnaryOpNot NameLoad body Global identifier Assign NameStore BinOpAdd NameLoad Num Assign NameStore BinOpMod Str NameLoad Assign NameStore BinOpMod Str TupleLoad NameLoad NameLoad If CompareIn NameLoad NameLoad body Raise Call NameLoad Num BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Pass Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr Num BinOpMod Str NameLoad Expr Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Str Call AttributeLoad Str attr NameLoad keyword Str Assign NameStore Call AttributeLoad NameLoad attr keyword ListLoad BinOpMod Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad AugAssignAdd NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str BinOpMod Str NameLoad keyword Str Assign NameStore Call AttributeLoad NameLoad attr Str Str keyword Str Return ListLoad NameLoad NameLoad NameLoad NameLoad decorator_list decorator_list Expr Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Global identifier If UnaryOpNot NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str Str keyword Str orelse Assign NameStore Call AttributeLoad NameLoad attr Str Str keyword Str Assign NameStore SubscriptLoad NameLoad Index Num Return ListLoad NameLoad decorator_list Assign AttributeStore NameLoad attr TupleLoad Num Num NameLoad Assign AttributeStore NameLoad attr Dict Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Call NameLoad keyword Str keyword Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults body Expr Str TryExcept body Assign NameStore Call NameLoad SubscriptLoad NameLoad Index Num handlers ExceptHandler type NameLoad body Assign NameStore Call NameLoad Return ListLoad Call AttributeLoad NameLoad attr Str Call NameLoad Call AttributeLoad Str attr NameLoad NameLoad NameLoad keyword Str decorator_list Assign AttributeStore NameLoad attr TupleLoad Num Num NameLoad Assign AttributeStore NameLoad attr Dict Str AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad For NameStore Call AttributeLoad NameLoad attr body If BoolOpOr Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str body Assign NameStore BinOpAdd BinOpAdd Str NameLoad Str orelse If NameLoad body Assign NameStore BinOpAdd BinOpAdd Str NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad Str attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Call AttributeLoad Call AttributeLoad Call AttributeLoad Call AttributeLoad Call AttributeLoad Call AttributeLoad Call AttributeLoad Call AttributeLoad Call AttributeLoad Call AttributeLoad Call AttributeLoad Call AttributeLoad Call AttributeLoad Call AttributeLoad Call AttributeLoad NameLoad attr Str Str attr Str Str attr Str Str attr Str Str attr Str Str attr Str Str attr Str Str attr Str Str attr Str Str attr Str Str attr Str Str attr Str Str attr Str Str attr Str Str attr Str Str attr Str Str Assign NameStore Call NameLoad NameLoad Assign NameStore ListLoad Assign NameStore NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore Num Assign NameStore Str While NameLoad body TryExcept body Assign NameStore Call AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Break If BoolOpAnd UnaryOpNot BoolOpOr NameLoad NameLoad NameLoad body If CompareEq NameLoad Str body Assign NameStore BinOpAdd NameLoad Num orelse If CompareEq NameLoad Str body Assign NameStore BinOpAdd NameLoad Num If BoolOpAnd NameLoad CompareNotEq NameLoad BinOpAdd NameLoad Num CompareEq NameLoad Str CompareNotEq NameLoad Str body TryExcept body Assign NameStore Call AttributeLoad NameLoad attr If BoolOpOr CompareIn NameLoad NameLoad Call AttributeLoad NameLoad attr body Assign NameStore NameLoad Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler body Assign NameStore NameLoad If NameLoad body Assign SubscriptStore NameLoad Index BinOpSub NameLoad Num Str Assign NameStore Str Assign NameStore NameLoad Assign NameStore NameLoad If BoolOpAnd NameLoad CompareNotEq NameLoad BinOpAdd NameLoad Num CompareEq NameLoad Str CompareNotEq NameLoad Str body TryExcept body Assign NameStore Call AttributeLoad NameLoad attr If BoolOpOr CompareIn NameLoad NameLoad Call AttributeLoad NameLoad attr body Assign NameStore NameLoad Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler body Assign NameStore NameLoad If NameLoad body Assign SubscriptStore NameLoad Index BinOpSub NameLoad Num Str Assign NameStore Str Assign NameStore NameLoad Assign NameStore NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore NameLoad AugAssignAdd NameStore Num If Call AttributeLoad NameLoad attr body Assign NameStore NameLoad orelse Assign NameStore NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad Str attr NameLoad attr Str Str Assign NameStore Call NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore NameStore NameStore NameLoad Assign NameStore ListLoad For TupleStore NameStore NameStore Call NameLoad Call NameLoad Call AttributeLoad NameLoad attr body If BinOpMod NameLoad Num body Assign NameStore NameLoad Assign NameStore NameLoad If BoolOpAnd NameLoad CompareEq SubscriptLoad NameLoad Index Num NameLoad body Assign NameStore NameLoad If CompareEq NameLoad Str body Assign NameStore TupleLoad Str Str orelse If CompareIn NameLoad ListLoad Str Str Str Str body Assign NameStore TupleLoad Str Str orelse If CompareIn NameLoad ListLoad Str body Assign NameStore TupleLoad Str Str orelse If CompareEq NameLoad Str body Assign NameStore TupleLoad Str Str orelse If CompareEq NameLoad Str body Assign NameStore TupleLoad Str Str orelse If CompareEq NameLoad Str body Assign NameStore TupleLoad Str Str orelse Assign NameStore NameLoad Assign NameStore NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str NameLoad Str orelse If NameLoad body If NameLoad body If CompareEq SubscriptLoad NameLoad Index Num Str body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Assign NameStore Call AttributeLoad Str attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign NameStore Call NameLoad Str NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr Index Num If NameLoad body If CompareGtE Call NameLoad NameLoad Num body Return BinOpAdd BinOpAdd BinOpAdd Str SubscriptLoad NameLoad Index Num Str SubscriptLoad NameLoad Slice Num Return Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr Index Num If CompareIn Str NameLoad body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Str Num orelse Assign NameStore NameLoad Return BinOpMod Str TupleLoad Call AttributeLoad Str attr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore ListLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad For NameStore NameLoad body If BoolOpAnd Call AttributeLoad NameLoad attr Str CompareNotEq Call AttributeLoad NameLoad attr Str Num Num body Assign NameStore Call AttributeLoad NameLoad attr Str Num Assign TupleStore NameStore NameStore TupleLoad SubscriptLoad NameLoad Slice Num NameLoad Call AttributeLoad SubscriptLoad NameLoad Slice BinOpAdd NameLoad Num attr If Call AttributeLoad Call AttributeLoad NameLoad attr attr Str body Assign NameStore NameLoad orelse Assign NameStore NameLoad If UnaryOpNot NameLoad body Expr Call NameLoad NameLoad While NameLoad body TryExcept body Assign NameStore Call AttributeLoad NameLoad attr If UnaryOpNot NameLoad body Expr Call NameLoad NameLoad handlers ExceptHandler body Break Assign NameStore Call AttributeLoad NameLoad attr If BoolOpAnd NameLoad UnaryOpNot BoolOpAnd Call AttributeLoad NameLoad attr Str CompareNotEq Call AttributeLoad NameLoad attr Str Num Num body AugAssignAdd NameStore BinOpAdd Str NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Delete SubscriptDel NameLoad Index Num Break Assign NameStore Call AttributeLoad NameLoad attr If CompareIn NameLoad NameLoad body Assign NameStore SubscriptLoad NameLoad Index NameLoad If Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse Assign SubscriptStore NameLoad Index NameLoad ListLoad NameLoad NameLoad orelse Assign SubscriptStore NameLoad Index NameLoad NameLoad orelse Expr Call NameLoad NameLoad Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults Str Str NameLoad NameLoad NameLoad body Expr Str Global identifier identifier identifier Assign NameStore Call NameLoad Assign NameStore Num Assign NameStore NameLoad If CompareIn NameLoad TupleLoad Str Str body Assign TupleStore NameStore NameStore NameStore NameStore NameLoad orelse If CompareIn NameLoad TupleLoad Str Str body Assign TupleStore NameStore NameStore NameStore NameStore NameLoad orelse If CompareEq NameLoad Str body Assign TupleStore NameStore NameStore NameStore NameStore NameLoad orelse Raise Call NameLoad BinOpMod Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Dict Str Str Str Str Num Num Assign NameStore Call NameLoad Str NameLoad If UnaryOpNot Call NameLoad NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad Str NameLoad Assign NameStore ListComp Call AttributeLoad Call AttributeLoad NameLoad attr Num attr comprehension NameStore Call AttributeLoad NameLoad attr If NameLoad body Assign TupleStore NameStore NameStore Call NameLoad NameLoad Dict NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Expr Call AttributeLoad Call NameLoad keyword NameLoad keyword Str attr NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr If UnaryOpNot NameLoad body Return Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr orelse If BoolOpAnd CompareEq NameLoad Str NameLoad body Assign NameStore BinOpMod Str TupleLoad Call AttributeLoad Str attr AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr orelse Assign NameStore Call AttributeLoad Str attr AttributeLoad NameLoad attr If CompareEq NameLoad Str body Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad Str NameLoad Assign NameStore Call NameLoad Str NameLoad Assign NameStore Call NameLoad Str NameLoad Assign NameStore Call NameLoad Str NameLoad Assign NameStore Call NameLoad Str NameLoad If NameLoad body If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr Str BoolOpOr BoolOpAnd AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num Str Expr Call AttributeLoad NameLoad attr Str BoolOpOr BoolOpAnd AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num Str Return TupleLoad NameLoad NameLoad Return NameLoad decorator_list
N/A N/A 
================
reStructuredText
================

reStructuredText is an easy to use markup language for plain text content. This
module provides a core utility function called ``render_rst`` which converts rST
into XHTML or LaTeX output formats.

  >>> text = '''
  ...
  ... This is a **test** document.
  ...
  ... '''

By default the output format of 'xhtml' is assumed:

  >>> render_rst(text)
  u'<p>This is a <strong>test</strong> document.</p>'

You can also pass in the alternative format of 'tex':

  >>> render_rst(text, format='tex')
  u'\n\\setlength{\\locallinewidth}{\\linewidth}\n\nThis is a \\textbf{test} document.\n'

This produces TeX output which should be run through an application like
``latex`` or ``pdflatex`` to get a typeset document.

By default the input is assumed to be either a unicode object or a str object
encoded as 'utf-8'. You can specify an alternative input encoding if needed:

  >>> text = '''
  ...
  ... Price in Caf\xe9s are often in \x80
  ...
  ... '''

  >>> render_rst(text, encoding='windows-1252')
  u'<p>Price in Caf\xe9s are often in \u20ac</p>'

The output is always a unicode object which can then be decoded into other
codecs if needed.

Let's look at a sample text with a few more elements:

  >>> text = '''
  ...
  ... ==============
  ... Some Big Title
  ... ==============
  ...
  ... Yet Another Title
  ... -----------------
  ...
  ... :Author: tav
  ... :Some-Field: some value
  ...
  ... Hello *world*!
  ...
  ... '''

You can set the optional ``as_whole`` parameter to True and a complete HTML or
LaTeX output will be generated with default headers and footers:

  >>> render_rst(text, as_whole=True)
  u'<?xml...<html...<p>Hello <em>world</em>!</p>\n</div>\n</body>\n</html>'

As opposed to just the rendered version of the text itself:

  >>> render_rst(text)
  u'<p>Hello <em>world</em>!</p>'

If you want the data in the bibliographic fields, you can get it by specifying
the optional ``with_docinfo`` parameter:

  >>> print render_rst(text, with_docinfo=True)
  <div class="docinfo">
  <table class="docinfo" frame="void" rules="none">
  <col class="docinfo-name" />
  <col class="docinfo-content" />
  <tbody valign="top">
  <tr><th class="docinfo-name">Author:</th>
  <td>tav</td></tr>
  <tr class="field"><th class="docinfo-name">Some-Field:</th><td class="field-body">some value</td>
  </tr>
  </tbody>
  </table>
  <BLANKLINE>
  </div>
  <div class="document">
  <p>Hello <em>world</em>!</p>
  </div>

If the bibliographic data is needed as a dictionary, then the optional
``with_props`` parameter can be specified:

  >>> output, props = render_rst(text, with_props=True)

  >>> output
  u'<p>Hello <em>world</em>!</p>'

  >>> sorted(props.keys())
  [u'author', u'some-field', u'subtitle', u'title']

As can be seen, this includes the bibliographic fields as well as the extracted
text title and subtitle:

  >>> props['author']
  u'tav'

  >>> props['some-field']
  u'some value'

  >>> props['title']
  u'Some Big Title'

  >>> props['subtitle']
  u'Yet Another Title'

The HTML output has a number of typographic additions like smart quotes and em
dashes:

  >>> text = '''
  ...
  ... "This is a quote" -- Gandhi
  ...
  ... '''

  >>> render_rst(text)
  u'<p>&ldquo;This is a quote&rdquo; &mdash; Gandhi</p>'

And, finally, in addition to the default directives, a ``syntax`` directive has
been added which allows for the syntax highlighting of included source code in a
variety of languages.

  >>> text = '''
  ...
  ... This is some text
  ...
  ... .. syntax:: python
  ...
  ...     double = lambda x: 2 * x
  ...
  ... '''

  >>> print render_rst(text)
  <p>This is some text</p>
  <div class="syntax"><pre>...<span class="k">lambda</span>...</pre></div>

 N/A os N/A re N/A sys string punctuation PUNCTUATION time time docutils nodes docutils.frontend OptionParser docutils.io FileInput docutils.parsers.rst directives Directive DirectiveError Parser docutils.parsers.rst.states RSTStateMachine state_classes docutils.readers.standalone Reader docutils.transforms writer_aux universal references frontmatter docutils.transforms misc docutils.writers.html4css1 HTMLTranslator Writer HTMLWriter docutils.writers.latex2e LaTeXTranslator Writer LaTexWriter docutils.utils relative_path new_document pygments highlight pygments.formatters HtmlFormatter pygments.lexers get_lexer_by_name TextLexer util.io IteratorParser N/A HTML_VISITOR_ATTRIBUTES N/A head_prefix head stylesheet body_prefix body_pre_docinfo docinfo body body_suffix title subtitle header footer meta fragment html_prolog html_head html_title html_subtitle html_body N/A LATEX_VISITOR_ATTRIBUTES N/A head_prefix head body_prefix body body_suffix N/A DEFAULT_TRANSFORMS N/A N/A universal Decorations N/A universal ExposeInternals N/A universal StripComments N/A references Substitutions N/A references PropagateTargets N/A frontmatter DocTitle N/A frontmatter SectionSubTitle N/A frontmatter DocInfo N/A references AnonymousHyperlinks N/A references IndirectHyperlinks N/A references Footnotes N/A references ExternalTargets N/A references InternalTargets N/A references DanglingReferences N/A misc Transitions N/A HTML_TRANSFORMS N/A DEFAULT_TRANSFORMS N/A N/A universal Messages N/A universal FilterMessages N/A universal StripClassesAndElements N/A writer_aux Admonitions N/A OPTION_PARSER N/A OptionParser N/A Parser Reader N/A HTML_OPTION_PARSER N/A OptionParser N/A Parser Reader HTMLWriter N/A LATEX_OPTION_PARSER N/A OptionParser N/A Parser Reader LaTexWriter N/A HTML_SETUP N/A html HTMLTranslator HTML_TRANSFORMS HTML_OPTION_PARSER N/A LATEX_SETUP N/A tex LaTeXTranslator DEFAULT_TRANSFORMS LATEX_OPTION_PARSER N/A RAW_SETUP N/A None None DEFAULT_TRANSFORMS OPTION_PARSER N/A replace_toc_attributes N/A N/A N/A re compile (?sm)<p class="topic-title(.*?)"><a name="(.*?)">(.*?)</a></p>(.*?)</div> sub N/A replace_drop_shadows N/A N/A N/A re compile (?sm)<div class="figure(.*?)<p><img(.*?)/></p>(.*?)</div> sub N/A replace_abstract_attributes N/A N/A N/A re compile <div class="abstract topic"> sub N/A replace_ampersands N/A N/A N/A re compile &(?![^\s&]*;) sub N/A replace_comments N/A N/A N/A re compile (?sm)\n?\s*<!--(.*?)\s-->\s*\n? sub N/A replace_plexlinks N/A N/A N/A re compile (?sm)\[\[(.*?)\]\] sub N/A replace_title_headings N/A N/A N/A re compile (?sm)<h1 class="title">(.*?)</h1> sub N/A replace_whitespace N/A N/A N/A re compile [] sub N/A split_html_tags N/A N/A N/A re compile (?sm)<(.*?)> split imap_directive N/A N/A name arguments options content lineno content_offset block_text state state_machine N/A N/A N/A Render an image <map> element. N/A encoding N/A N/A options get encoding N/A N/A N/A state document settings input_encoding N/A image_alt N/A N/A options get alt N/A image_class N/A N/A options get class N/A N/A attributes N/A source imap_source N/A arguments N/A 0 N/A source_dir N/A N/A N/A os path dirname N/A N/A N/A os path abspath N/A N/A state document current_source N/A path N/A N/A N/A os path normpath N/A N/A N/A os path join source_dir imap_source N/A path N/A relative_path None path N/A N/A N/A N/A N/A N/A N/A N/A state document settings record_dependencies add path N/A raw_file N/A FileInput source_path path encoding encoding error_handler N/A N/A N/A state document settings input_encoding_error_handler handle_io_errors None N/A N/A N/A IOError N/A error N/A N/A severe N/A N/A N/A state_machine reporter severe N/A Problems with "%s" directive path:
%s. N/A name error N/A N/A nodes literal_block block_text block_text line lineno N/A N/A severe N/A text N/A N/A N/A N/A N/A N/A raw_file read replace ALT-GOES-HERE image_alt replace CLASS-GOES-HERE image_class N/A raw_node N/A N/A nodes raw text format html N/A N/A raw_node N/A N/A N/A imap_directive arguments N/A 1 0 False N/A N/A imap_directive options N/A alt class N/A directives unchanged N/A directives class_option N/A N/A imap_directive content False break_directive N/A N/A name arguments options content lineno content_offset block_text state state_machine N/A N/A N/A Render an HTML break element. N/A arguments N/A N/A break_class N/A arguments N/A 0 N/A N/A break_class clear N/A raw_node N/A N/A nodes raw N/A <hr class="%s" /> break_class format html N/A N/A raw_node N/A N/A N/A break_directive arguments N/A 0 1 True N/A N/A break_directive options N/A class N/A directives class_option N/A N/A break_directive content False N/A N/A N/A directives register_directive break break_directive N/A SEEN_TAGS_CACHE None N/A TAG_COUNTER None TagDirective N/A Directive N/A N/A Convert tags into HTML annotation blocks. N/A required_arguments 0 N/A optional_arguments 1 N/A final_argument_whitespace True N/A has_content True run N/A N/A self tag_cache N/A N/A N/A N/A N/A N/A self content N/A N/A N/A N/A N/A self arguments N/A N/A arguments N/A N/A N/A N/A N/A N/A self arguments N/A 0 strip split , N/A N/A arguments N/A N/A tag_list_id N/A CURRENT_PLAN_ID list N/A output N/A N/A add N/A output append N/A tag_id None N/A tag arguments N/A N/A N/A tag tag_cache N/A N/A N/A add N/A tag_cache N/A tag N/A N/A ori_tag tag N/A tag N/A N/A N/A N/A N/A N/A tag strip rstrip , strip N/A N/A tag N/A N/A N/A N/A N/A tag startswith id: N/A N/A tag_id N/A tag N/A 3 N/A N/A N/A N/A tag startswith @ N/A N/A tag_class N/A N/A - join N/A N/A N/A N/A N/A tag N/A 1 lower split N/A tag_type zuser N/A tag_text tag N/A N/A N/A N/A tag startswith # N/A N/A tag_class N/A N/A - join N/A N/A N/A N/A N/A tag N/A 1 lower split N/A tag_type 2 N/A tag_text tag N/A N/A N/A : tag N/A N/A tag_split N/A N/A tag split : 1 N/A N/A N/A len tag_split 2 N/A N/A N/A tag_type tag_text tag_split N/A N/A tag_type N/A tag_split N/A 0 N/A tag_text N/A tag_type N/A N/A N/A N/A tag_type strip lower N/A N/A N/A tag_type dep N/A : tag_text N/A N/A tag_class N/A dep-%s-%s N/A CURRENT_PLAN_ID tag_text N/A N/A tag_class N/A N/A - join N/A N/A N/A N/A N/A N/A tag replace : lower split N/A N/A tag_class N/A N/A - join N/A N/A N/A N/A tag lower split N/A tag_type 1 N/A tag_text N/A N/A tag upper N/A N/A : tag N/A N/A lead N/A N/A N/A tag split : 1 N/A 0 N/A tag_name N/A %s:%s N/A N/A N/A lead lower tag_text N/A N/A tag_name tag_text N/A tag_span N/A <span class="tag tag-type-%s tag-val-%s" tagname="%s" tagnorm="%s">%s</span>  N/A tag_type tag_class tag_name N/A N/A tag lower tag_text N/A N/A tag_cache N/A ori_tag tag_span N/A N/A add tag_span N/A N/A N/A output sort N/A N/A tag_id N/A N/A TAG_COUNTER N/A TAG_COUNTER N/A TAG_COUNTER 1 N/A tag_id N/A temp-%s TAG_COUNTER N/A tag_id N/A %s-%s N/A tag_list_id tag_id N/A N/A tag_id SEEN_TAGS_CACHE N/A N/A N/A DirectiveError 2 N/A The tag id %r has already been used! tag_id N/A N/A N/A SEEN_TAGS_CACHE add tag_id N/A N/A output N/A N/A N/A N/A N/A output append N/A <a class="tag-link" href="#tag-ref-%s-main">&middot;</a> tag_id N/A N/A N/A output insert 0 N/A <div class="tag-segment" id="tag-ref-%s"> tag_id N/A N/A add </div> N/A tag_info N/A N/A nodes raw N/A N/A join output format html N/A tag_content_container N/A N/A nodes bullet_list ids N/A N/A tag-ref-%s-content tag_id N/A tag_content N/A N/A nodes list_item N/A N/A N/A N/A self state nested_parse N/A self content N/A self content_offset tag_content N/A tag_content_container tag_content N/A prefix N/A N/A nodes raw N/A <div id="tag-ref-%s-main" class="tag-content"> tag_id format html N/A suffix N/A N/A nodes raw </div> format html N/A N/A prefix tag_content_container tag_info suffix N/A N/A N/A N/A N/A directives register_directive tag TagDirective N/A CURRENT_PLAN_ID None plan_directive N/A N/A name arguments options content lineno content_offset block_text state state_machine N/A N/A N/A Setup for tags relating to a plan file. N/A CURRENT_PLAN_ID N/A N/A CURRENT_PLAN_ID N/A N/A raw_node N/A N/A nodes raw <div id="plan-container"></div><script type="text/javascript" src="http://cloud.github.com/downloads/tav/plexnet/js.plan.js"></script><hr class="clear" /> format html N/A N/A raw_node N/A N/A nodes raw format html N/A CURRENT_PLAN_ID N/A arguments N/A 0 N/A N/A raw_node N/A N/A N/A plan_directive arguments N/A 1 0 True N/A N/A plan_directive options N/A N/A N/A plan_directive content False N/A N/A N/A directives register_directive plan plan_directive N/A SYNTAX_FORMATTER N/A HtmlFormatter cssclass syntax lineseparator <br/> syntax_directive N/A N/A name arguments options content lineno content_offset block_text state state_machine N/A N/A N/A Prettify <syntax> snippets into marked up HTML blocks. N/A N/A N/A lexer N/A get_lexer_by_name N/A arguments N/A 0 N/A N/A N/A ValueError N/A N/A lexer N/A TextLexer N/A N/A N/A N/A nodes raw N/A highlight N/A N/A join content lexer SYNTAX_FORMATTER format html N/A N/A N/A syntax_directive arguments N/A 1 0 False N/A N/A syntax_directive options N/A format N/A directives unchanged N/A N/A syntax_directive content True N/A N/A N/A directives register_directive syntax syntax_directive doctest2html N/A N/A content N/A N/A N/A Convert doctest strings to CSS'd HTML. N/A out N/A N/A line N/A N/A content splitlines N/A N/A N/A N/A N/A line startswith &gt;&gt;&gt; N/A N/A line startswith ... N/A N/A line N/A N/A <span class="doctest-input"> line </span> N/A N/A line N/A N/A line N/A N/A <span class="doctest-output"> line </span> N/A N/A N/A out append line N/A N/A N/A join out N/A convert N/A N/A content N/A N/A N/A Convert certain characters to prettier typographical syntax. N/A content N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A content replace &quot; " replace  --> HTML-COMMENT-ELEMENT-CLOSE replace -&gt; &rarr; replace <- &larr; replace --- &ndash; replace -- &mdash; replace << &laquo; replace >> &raquo; replace (C) &copy; replace (c) &copy; replace (tm) &trade; replace (TM) &trade; replace (r) &reg; replace (R) &reg; replace ... &#8230; replace HTML-COMMENT-ELEMENT-CLOSE  --> N/A icontent N/A IteratorParser content N/A content N/A N/A _scurly _dcurly False N/A _space True N/A _apply False N/A index 0 N/A prev N/A True N/A N/A N/A N/A char N/A N/A icontent next N/A N/A N/A StopIteration N/A N/A N/A N/A N/A N/A _scurly _dcurly _space N/A N/A N/A char ' N/A N/A _scurly N/A index 1 N/A N/A N/A char " N/A N/A _dcurly N/A index 1 N/A N/A _scurly N/A _scurly N/A index 1 N/A char ' N/A prev \ N/A N/A N/A N/A n N/A N/A icontent next N/A N/A N/A n PUNCTUATION N/A N/A n isspace N/A N/A _apply True N/A N/A N/A icontent push n N/A N/A N/A N/A _apply True N/A _apply N/A N/A N/A content N/A N/A _scurly 1 &lsquo; N/A char &rsquo; N/A _scurly False N/A _apply False N/A N/A _dcurly N/A _dcurly N/A index 1 N/A char " N/A prev \ N/A N/A N/A N/A n N/A N/A icontent next N/A N/A N/A n PUNCTUATION N/A N/A n isspace N/A N/A _apply True N/A N/A N/A icontent push n N/A N/A N/A N/A _apply True N/A _apply N/A N/A N/A content N/A N/A _dcurly 1 &ldquo; N/A char &rdquo; N/A _dcurly False N/A _apply False N/A N/A N/A content append char N/A prev char N/A index 1 N/A N/A N/A char isspace N/A N/A _space True N/A N/A _space False N/A content N/A N/A N/A N/A join content replace " &quot; N/A content N/A replace_plexlinks render_plexlink content N/A content N/A escape_and_prettify N/A N/A content N/A N/A N/A Escape angle brackets appropriately and prettify certain blocks. N/A _literal_block _element _content False N/A output N/A N/A N/A i block N/A enumerate N/A split_html_tags N/A N/A content strip N/A N/A N/A i 2 N/A N/A _content False N/A _element True N/A N/A _literal_block N/A N/A _literal_block N/A 1 block N/A N/A _literal_block False N/A N/A block tt class="literal" N/A N/A _literal_block N/A tt /tt N/A N/A N/A block N/A pre pre class="literal-block" pre class="last literal-block" pre class="code" N/A N/A _literal_block N/A pre /pre N/A N/A N/A block N/A span class="pre" N/A N/A _literal_block N/A span /span N/A N/A N/A block pre class="doctest-block" N/A N/A _literal_block N/A doctest /pre N/A N/A N/A block style type="text/css" N/A N/A _literal_block N/A style type="text/css" /style N/A N/A N/A block script type="text/javascript" N/A N/A _literal_block N/A script type="text/javascript" /script N/A N/A _content True N/A _element False N/A _element N/A N/A N/A N/A output append N/A N/A < block > N/A N/A _content N/A N/A _literal_block N/A N/A N/A N/A _literal_block N/A 0 doctest N/A N/A N/A N/A output append N/A doctest2html block N/A N/A N/A N/A output append block N/A N/A N/A N/A output append N/A convert block N/A output N/A N/A join output N/A output N/A N/A output replace << &lt;< N/A output N/A replace_ampersands &amp; output N/A output N/A render_drop_cap N/A N/A content N/A N/A N/A Render the first character as a drop capital N/A content N/A N/A N/A content groups N/A 0 N/A content N/A N/A N/A N/A len content 2 N/A N/A N/A N/A N/A <p><span class="dropcap"> N/A content N/A 0 </span> N/A content N/A 1 N/A <p></p> N/A render_plexlink N/A N/A content N/A N/A N/A Render [[plexlinks]]. N/A name N/A N/A N/A content groups N/A 0 N/A N/A | name N/A N/A N/A name linkname N/A N/A name split | 1 N/A N/A linkname name N/A N/A <a href="%s.html">%s</a> N/A N/A N/A - join N/A N/A name split linkname N/A parse_headers N/A N/A source_lines props toplevel N/A False N/A N/A Parse the metadata stored in the content headers. N/A new_data N/A N/A out N/A new_data append N/A iterative_source N/A IteratorParser source_lines N/A line iterative_source N/A N/A N/A N/A N/A line startswith : N/A N/A N/A line find : 2 -1 N/A N/A marker N/A N/A line find : 2 N/A N/A prop value N/A N/A line N/A 1 marker N/A N/A N/A line N/A N/A marker 1 strip N/A N/A N/A N/A N/A prop lower startswith x- N/A N/A _strip_prop True N/A N/A _strip_prop False N/A N/A _strip_prop N/A N/A N/A out line N/A True N/A N/A N/A N/A line N/A N/A iterative_source next N/A N/A _strip_prop N/A N/A N/A out line N/A N/A N/A N/A N/A sline N/A N/A line strip N/A N/A sline N/A N/A N/A N/A sline startswith : N/A N/A N/A sline find : 2 -1 N/A N/A value N/A sline N/A N/A N/A N/A iterative_source push line N/A N/A _strip_prop N/A N/A N/A new_data N/A -1 N/A N/A prop N/A N/A prop lower N/A N/A prop props N/A N/A oldvalue N/A props N/A prop N/A N/A isinstance oldvalue list N/A N/A N/A N/A oldvalue append value N/A N/A N/A props N/A prop N/A oldvalue value N/A N/A N/A props N/A prop value N/A N/A N/A out line N/A N/A new_data props N/A render_rst N/A N/A source format encoding with_props with_docinfo as_whole N/A xhtml utf-8 False False False N/A N/A Return the rendered ``source`` with optional extracted properties. N/A SEEN_TAGS_CACHE TAG_COUNTER CURRENT_PLAN_ID N/A SEEN_TAGS_CACHE N/A set N/A TAG_COUNTER 0 N/A CURRENT_PLAN_ID None N/A N/A format N/A xhtml html N/A N/A N/A format translator transforms option_parser HTML_SETUP N/A N/A N/A format N/A tex latex N/A N/A N/A format translator transforms option_parser LATEX_SETUP N/A N/A N/A format raw N/A N/A N/A format translator transforms option_parser RAW_SETUP N/A N/A N/A ValueError N/A Unknown format: %r format N/A settings N/A N/A option_parser get_default_values N/A N/A N/A settings _update_loose N/A footnote_references halt_level trim_footnote_reference_space superscript 6 1 N/A document N/A new_document [dynamic-text] settings N/A N/A N/A isinstance source unicode N/A N/A source N/A unicode source encoding N/A source N/A replace_whitespace source N/A source_lines N/A N/A N/A N/A N/A s expandtabs 4 rstrip N/A s N/A N/A source splitlines N/A with_props N/A N/A N/A source_lines props N/A parse_headers source_lines N/A True N/A N/A N/A N/A document reporter attach_observer N/A document note_parse_message N/A N/A N/A N/A RSTStateMachine state_classes state_classes initial_state Body run source_lines document N/A N/A N/A N/A document reporter detach_observer N/A document note_parse_message N/A N/A document current_source N/A document current_line None N/A N/A N/A N/A document transformer add_transforms transforms N/A N/A N/A N/A document transformer apply_transforms N/A N/A format N/A N/A N/A unicode document N/A visitor N/A translator document N/A N/A N/A document walkabout visitor N/A as_whole N/A N/A output N/A N/A visitor astext N/A N/A N/A N/A format html with_docinfo N/A N/A output N/A <div class="docinfo">
%s
</div>
<div class="document">
%s</div> N/A N/A N/A join N/A visitor docinfo N/A N/A join N/A visitor body N/A N/A output N/A N/A join N/A visitor body N/A N/A format html N/A N/A output N/A escape_and_prettify output N/A output N/A replace_toc_attributes <p class="topic-title\1"><a name="\2"></a><span id="document-toc">\3</span></p>
<div id="document-toc-listing">\4</div></div> output N/A output N/A replace_abstract_attributes <div id="abstract" class="abstract topic"> output N/A output N/A replace_drop_shadows <div class="figure\1<div class="wrap1"><div class="wrap2"><div class="wrap3"><img\2/></div></div></div>\3</div> output N/A output N/A replace_comments output N/A output N/A replace_title_headings output N/A with_props N/A N/A N/A format html N/A N/A N/A N/A props setdefault title N/A N/A N/A visitor title N/A N/A visitor title N/A 0 N/A N/A N/A props setdefault subtitle N/A N/A N/A visitor subtitle N/A N/A visitor subtitle N/A 0 N/A N/A output props N/A output N/A