Home | Trees | Indices | Help |
|
---|
|
Parser for epytext strings. Epytext is a lightweight markup whose primary intended application is Python documentation strings. This parser converts Epytext strings to a simple DOM-like representation (encoded as a tree of Element objects and strings). Epytext strings can contain the following structural blocks:
doctest
module.
Additionally, the following inline regions may be used within para
blocks:
The returned DOM tree will conform to the the following Document Type Description:
<!ENTITY % colorized '(code | math | index | italic | bold | uri | link | symbol)*'> <!ELEMENT epytext ((para | literalblock | doctestblock | section | ulist | olist)*, fieldlist?)> <!ELEMENT para (#PCDATA | %colorized;)*> <!ELEMENT section (para | listblock | doctestblock | section | ulist | olist)+> <!ELEMENT fieldlist (field+)> <!ELEMENT field (tag, arg?, (para | listblock | doctestblock) ulist | olist)+)> <!ELEMENT tag (#PCDATA)> <!ELEMENT arg (#PCDATA)> <!ELEMENT literalblock (#PCDATA | %colorized;)*> <!ELEMENT doctestblock (#PCDATA)> <!ELEMENT ulist (li+)> <!ELEMENT olist (li+)> <!ELEMENT li (para | literalblock | doctestblock | ulist | olist)+> <!ATTLIST li bullet NMTOKEN #IMPLIED> <!ATTLIST olist start NMTOKEN #IMPLIED> <!ELEMENT uri (name, target)> <!ELEMENT link (name, target)> <!ELEMENT name (#PCDATA | %colorized;)*> <!ELEMENT target (#PCDATA)> <!ELEMENT code (#PCDATA | %colorized;)*> <!ELEMENT math (#PCDATA | %colorized;)*> <!ELEMENT italic (#PCDATA | %colorized;)*> <!ELEMENT bold (#PCDATA | %colorized;)*> <!ELEMENT indexed (#PCDATA | %colorized;)> <!ATTLIST code style CDATA #IMPLIED> <!ELEMENT symbol (#PCDATA)>
|
|||
Element A very simple DOM-like representation for parsed epytext documents. |
|||
TokenToken s are an intermediate data structure used while
constructing the structuring DOM tree for a formatted docstring.
|
|||
TokenizationError An error generated while tokenizing a formatted documentation string. |
|||
StructuringError An error generated while structuring a formatted documentation string. |
|||
ColorizingError An error generated while colorizing a paragraph. |
|||
ParsedEpytextDocstring |
|
|||
Element
|
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
int
|
|
||
int
|
|
||
int
|
|
||
int
|
|
||
list of Token
|
|
||
Element
|
|
||
|
|||
|
|||
string
|
|
||
string
|
|
||
string
|
|
||
string
|
|
||
Element
|
|
||
Element
|
|
||
Element
|
|
||
ParsedDocstring |
|
|
|||
_HEADING_CHARS =
|
|||
_ESCAPES =
|
|||
SYMBOLS =
A list of the of escape symbols that are supported by epydoc. |
|||
_SYMBOLS =
|
|||
__doc__ = __doc__.replace('<<<SYMBOLS>>>', symblist)
|
|||
_COLORIZING_TAGS =
|
|||
_LINK_COLORIZING_TAGS =
|
|||
_BULLET_RE = re.compile(r'-
|
|||
_LIST_BULLET_RE = re.compile(r'-
|
|||
_FIELD_BULLET_RE = re.compile(r'@\w
|
|||
_BRACE_RE = re.compile(r'
|
|||
_TARGET_RE = re.compile(r'^
|
|||
GRAPH_TYPES =
|
|||
SYMBOL_TO_PLAINTEXT =
|
|||
SCRWIDTH = 75
|
|
Return a DOM tree encoding the contents of an epytext string. Any
errors generated during parsing will be stored in
|
Pop any completed blocks off the stack. This includes any blocks that we have dedented past, as well as any list item blocks that we've dedented to. The top element on the stack should only be a list if we're about to start a new list item (i.e., if the next token is a bullet). |
Add a new list item or field to the DOM tree, with the given bullet or field tag. When necessary, create the associated list. |
Construct a Token containing the doctest block starting at
|
Construct a Token containing the literal block starting at
|
Construct Tokens for the bullet and the first paragraph of the
list item (or field) starting at
|
Construct a Token containing the paragraph starting at
|
Split a given formatted docstring into an ordered list of
|
Given a string containing the contents of a paragraph, produce a DOM
|
Eg: G{classtree} G{classtree x, y, z} G{importgraph} |
Convert a DOM document encoding epytext back to an epytext string. This is the inverse operation from parse. I.e., assuming there are no errors, the following is true:
The inverse is true, except that whitespace, line wrapping, and character escaping may be done differently.
|
Convert a DOM document encoding epytext to a string representation.
This representation is similar to the string generated by
|
Convert a DOM document encoding epytext back to an epytext string, annotated with extra debugging information. This function is similar to to_epytext, but it adds explicit information about where different blocks begin, along the left margin.
|
Convert a DOM document encoding epytext into a reStructuredText markup string. (Because rst is fairly loosely defined, it is possible that this function will produce incorrect output in some cases.)
|
Pretty-parse the string. This parses the string, and catches any warnings or errors produced. Any warnings and errors are displayed, and the resulting DOM parse structure is returned.
|
Return a DOM document matching the epytext DTD, containing a single literal block. That literal block will include the contents of the given string. This method is typically used as a fall-back when the parser fails.
|
Return a DOM document matching the epytext DTD, containing a single paragraph. That paragraph will include the contents of the given string. This can be used to wrap some forms of automatically generated information (such as type names) in paragraphs.
|
Parse the given docstring, which is formatted using epytext; and
return a
|
|
SYMBOLSA list of the of escape symbols that are supported by epydoc. Currently the following symbols are supported:
|
_SYMBOLS
|
_COLORIZING_TAGS
|
_BULLET_RE
|
GRAPH_TYPES
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Fri Jun 13 23:50:20 2008 | http://epydoc.sourceforge.net |