Package epydoc :: Package markup :: Module restructuredtext
[show private | hide private]
[frames | no frames]

Module epydoc.markup.restructuredtext

Epydoc parser for ReStructuredText strings. ReStructuredText is the standard markup language used by the Docutils project. parse_docstring() provides the primary interface to this module; it returns a ParsedRstDocstring, which supports all of the methods defined by ParsedDocstring.

ParsedRstDocstring is basically just a ParsedDocstring wrapper for the docutils.nodes.document class.

Creating ParsedRstDocstrings

ParsedRstDocstrings are created by the parse_document function, using the docutils.core.publish_string() method, with the following helpers:

Using ParsedRstDocstrings

ParsedRstDocstrings support all of the methods defined by ParsedDocstring; but only the following four methods have non-default behavior:

To Do: Add ParsedRstDocstring.to_latex()

Classes
ParsedRstDocstring An encoded version of a ReStructuredText docstring.

Function Summary
ParsedDocstring parse_docstring(docstring, errors, **options)
Parse the given docstring, which is formatted using ReStructuredText; and return a ParsedDocstring representation of its contents.

Variable Summary
dict CONSOLIDATED_FIELDS: A dictionary encoding the set of 'consolidated fields' that can be used.

Function Details

parse_docstring(docstring, errors, **options)

Parse the given docstring, which is formatted using ReStructuredText; and return a ParsedDocstring representation of its contents.
Parameters:
docstring - The docstring to parse
           (type=string)
errors - A list where any errors generated during parsing will be stored.
           (type=list of ParseError)
options - Extra options. Unknown options are ignored. Currently, no extra options are defined.
Returns:
ParsedDocstring

Variable Details

CONSOLIDATED_FIELDS

A dictionary encoding the set of 'consolidated fields' that can be used. Each consolidated field is marked by a single tag, and contains a single bulleted list, where each list item starts with an identifier, marked as interpreted text (`...`). This module automatically splits these consolidated fields into individual fields. The keys of CONSOLIDATED_FIELDS are the names of possible consolidated fields; and the values are the names of the field tags that should be used for individual entries in the list.
Type:
dict
Value:
{'arguments': 'arg',
 'cvariables': 'cvar',
 'exceptions': 'except',
 'groups': 'group',
 'ivariables': 'ivar',
 'keywords': 'keyword',
 'parameters': 'param',
 'types': 'type',
...                                                                    

Generated by Epydoc 2.1 on Sat Mar 20 17:46:13 2004 http://epydoc.sf.net