Home | Trees | Index | Help |
|
---|
|
Parse docstrings and handle any fields it defines, such as
@type
and @author
. Fields are used to describe
specific information about an object. There are two classes of fields:
simple fields
and special
fields.
Simple fields are fields that get stored directly in an
APIDoc
's metadata dictionary, without any special
processing. The set of simple fields is defined by the list
STANDARD_FIELDS, whose elements are DocstringFields.
APIDoc
, or add information to attributes other than the
metadata dictionary. Special fields are are handled by field handler
functions, which are registered using register_field_handler.
|
|||
DocstringField | A simple docstring field, which can be used to describe specific information about an object, such as its author or its version. |
|
|||
Docstring Parsing | |||
---|---|---|---|
parse_docstring(api_doc,
docindex)
Process the given APIDoc 's docstring.
|
|||
initialize_api_doc(api_doc)
A helper function for parse_docstring() that initializes the attributes that parse_docstring() will write to.
|
|||
report_errors(api_doc,
docindex,
parse_errors,
field_warnings)
A helper function for parse_docstring() that reports any markup warnings and field warnings that we encountered while processing api_doc 's docstring.
|
|||
Field Processing | |||
process_field(api_doc,
docindex,
tag,
arg,
descr)
Process a single field, and use it to update api_doc .
|
|||
user_docfields(api_doc,
docindex)
Return a list of user defined fields that can be used for the given object. |
|||
register_field_handler(handler,
*field_tags)
Register the given field handler function for processing any of the given field tags. |
|||
Field Handler Functions | |||
process_summary_field(api_doc,
docindex,
tag,
arg,
descr)
Store descr in api_doc.summary
|
|||
process_include_field(api_doc,
docindex,
tag,
arg,
descr)
Copy the docstring contents from the object named in descr
|
|||
process_undocumented_field(api_doc,
docindex,
tag,
arg,
descr)
Remove any documentation for the variables named in descr
|
|||
process_group_field(api_doc,
docindex,
tag,
arg,
descr)
Define a group named arg containing the variables
whose names are listed in descr .
|
|||
process_deffield_field(api_doc,
docindex,
tag,
arg,
descr)
Define a new custom field. |
|||
process_raise_field(api_doc,
docindex,
tag,
arg,
descr)
Record the fact that api_doc can raise the exception
named tag in api_doc.exception_descrs .
|
|||
process_sort_field(api_doc, docindex, tag, arg, descr) | |||
process_type_field(api_doc, docindex, tag, arg, descr) | |||
process_var_field(api_doc, docindex, tag, arg, descr) | |||
process_cvar_field(api_doc, docindex, tag, arg, descr) | |||
process_ivar_field(api_doc, docindex, tag, arg, descr) | |||
process_return_field(api_doc, docindex, tag, arg, descr) | |||
process_rtype_field(api_doc, docindex, tag, arg, descr) | |||
process_arg_field(api_doc, docindex, tag, arg, descr) | |||
process_kwarg_field(api_doc, docindex, tag, arg, descr) | |||
Helper Functions | |||
set_var_descr(api_doc, ident, descr) | |||
set_var_type(api_doc, ident, descr) | |||
_check(api_doc, tag, arg, context=None, expect_arg=None) | |||
get_docformat(api_doc,
docindex)
Return the name of the markup language that should be used to parse the API documentation for the given object. |
|||
unindent_docstring(docstring) | |||
list of string
|
_descr_to_identifiers(descr)
Given a ParsedDocstring that contains a list of
identifiers, return a list of those identifiers.
|
||
_descr_to_docstring_field(arg, descr) | |||
Function Signature Extraction | |||
None
|
parse_function_signature(func_doc)
Construct the signature for a builtin function or method from its docstring. |
|
|||
STANDARD_FIELDS | A list of the standard simple fields accepted by epydoc. | ||
Docstring Parsing | |||
---|---|---|---|
DEFAULT_DOCFORMAT | The name of the default markup languge used to process docstrings. | ||
Field Processing Error Messages | |||
UNEXPECTED_ARG | |||
EXPECTED_ARG | |||
EXPECTED_SINGLE_ARG | |||
BAD_CONTEXT | |||
REDEFINED | |||
UNKNOWN_TAG | |||
Field Processing | |||
_field_dispatch_table | |||
Helper Functions | |||
_IDENTIFIER_LIST_REGEXP | |||
Function Signature Extraction | |||
_SIGNATURE_RE | A regular expression that is used to extract signatures from docstrings. |
|
APIDoc 's docstring. In particular,
populate the APIDoc 's descr and
summary attributes, and add any information provided by
fields in the docstring.
|
parse_docstring() will write to.
|
api_doc 's docstring.
|
api_doc . If
tag is the name of a special field, then call its handler
function. If tag is the name of a simple field, then use
process_simple_field to process it. Otherwise, check if
it's a user-defined field, defined in this docstring or the docstring of
a containing object; and if so, process it with
process_simple_field .
|
api_doc , and any
of its containing NamepaceDoc s.
|
>>> def field_handler(api_doc, docindex, tag, arg, descr):
... '''update api_doc in response to the field.'''
Where api_doc is the documentation object to update;
docindex is a DocIndex that can be used to look up the documentation
for related objects; tag is the field tag that was used;
arg is the optional argument; and descr is the
description following the field tag and argument.
|
descr in api_doc.summary
|
descr
|
descr
|
arg containing the variables whose
names are listed in descr .
|
|
api_doc can raise the exception
named tag in api_doc.exception_descrs .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ParsedDocstring that contains a list of
identifiers, return a list of those identifiers. This is used by fields
such as @group and @sort , which expect lists of
identifiers as their values. To extract the identifiers, the docstring
is first converted to plaintext, and then split. The plaintext content
of the docstring must be a a list of identifiers, separated by spaces,
commas, colons, or semicolons.
|
|
"..." .
|
|
STANDARD_FIELDSA list of the standard simple fields accepted by epydoc. This list can be augmented at run-time by a docstring with the special@deffield field. The order in which fields are listed here
determines the order in which they will be displayed in the output.
|
DEFAULT_DOCFORMATThe name of the default markup languge used to process docstrings.
|
UNEXPECTED_ARG
|
EXPECTED_ARG
|
EXPECTED_SINGLE_ARG
|
BAD_CONTEXT
|
REDEFINED
|
UNKNOWN_TAG
|
_field_dispatch_table
|
_IDENTIFIER_LIST_REGEXP
|
_SIGNATURE_REA regular expression that is used to extract signatures from docstrings.
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 3.0alpha2 on Tue Apr 11 17:31:11 2006 | http://epydoc.sf.net |