Convert pydoctor.epydoc
parsed markup into renderable content.
Class |
|
Like pydoctor.epydoc.markup.Field , but without the gross accessor methods and with a formatted body. |
Class |
|
Combines informations from multiple Field objects into one. |
Class |
|
No class docstring; 0/13 instance variable, 2/22 methods, 0/1 static method documented |
Class |
|
Encapsulate the name of kwarg parameters. |
Class |
|
A ParsedDocstring directly constructed from stan, for caching purposes. |
Class |
|
Description of an exception that can be raised by function/method. |
Class |
|
Encapsulate the name of vararg parameters. |
Function | colorized |
This fallback function uses ParsedDocstring.to_node() , so it must be used only with ParsedDocstring subclasses that implements to_node(). |
Function | ensure |
Currently, it's not 100% clear at what point the Documentable.parsed_docstring attribute is set. It can be set from the ast builder or later processing step. |
Function | extract |
Populate Attributes for module/class variables using fields from that module/class's docstring. Must only be called for objects that have a docstring. |
Function | format |
Should be only called for Attribute objects that have the Attribute.value property set. |
Function | format |
Format list of FieldDesc . Used for param, returns, raises, etc. |
Function | format |
Generate an HTML representation of a docstring |
Function | format |
Undocumented |
Function | format |
Format list of Field object. Used for notes, see also, authors, etc. |
Function | format |
Transform a `model.DocumentableKind` Enum value to string. |
Function | format |
Generate an shortened HTML representation of a docstring. |
Function | format |
Undocumented |
Function | format |
Undocumented |
Function | format |
Generate an HTML representation for an object lacking a docstring. |
Function | get |
Fetch the docstring for a documentable. Treat empty docstring as undocumented. |
Function | get |
Undocumented |
Function | get |
Get the parse_docstring(str, List[ParseError], bool) -> ParsedDocstring function. |
Function | get |
Undocumented |
Function | insert |
Browsers aren't smart enough to recognize word breaking opportunities in snake_case or camelCase, so this function helps them out by inserting word break opportunities. |
Function | parse |
Parse a docstring. |
Function | report |
Undocumented |
Function | report |
Undocumented |
Function | safe |
Wraps ParsedDocstring.to_stan() to catch exception and handle them in fallback. This is used to convert docstrings as well as other colorized AST values to stan. |
Function | type2stan |
Undocumented |
Constant | BROKEN |
Undocumented |
Variable | field |
Undocumented |
Function | _format |
Undocumented |
Function | _get |
Ensures that the model.Documentable.parsed_summary attribute of a documentable is set to it's final value. Do not generate summary twice. |
Function | _is |
Does this AST node represent the literal constant None? |
Function | _split |
Undocumented |
This fallback function uses ParsedDocstring.to_node()
, so it must be used only with ParsedDocstring
subclasses that implements to_node().
Parameters | |
_:List[ | Undocumented |
doc:ParsedDocstring | Undocumented |
__:model.Documentable | Undocumented |
Returns | |
Tag | Undocumented |
Currently, it's not 100% clear at what point the Documentable.parsed_docstring
attribute is set. It can be set from the ast builder or later processing step.
This function ensures that the parsed_docstring attribute of a documentable is set to it's final value.
Parameters | |
obj:model.Documentable | Undocumented |
Returns | |
Optional[ |
|
Populate Attributes for module/class variables using fields from that module/class's docstring. Must only be called for objects that have a docstring.
Parameters | |
obj:model.Documentable | Undocumented |
Should be only called for Attribute
objects that have the Attribute.value
property set.
Parameters | |
obj:model.Attribute | Undocumented |
Returns | |
Flattenable | Undocumented |
Format list of FieldDesc
. Used for param, returns, raises, etc.
Generates a 2-columns layout as follow:
+------------------------------------+ | <label> | | <name>: <type> | <desc> | | <name>: <type> | <desc> | +------------------------------------+
If the fields don't have type or name information, generates the same output as format_field_list
:
+------------------------------------+ | <label> | | <desc ... > | +------------------------------------+
Parameters | |
label:str | Section "mini heading" |
descs:Sequence[ | FieldDesc s |
Returns | |
Iterator[ | Each row as iterator or None if no descs id provided. |
Generate an HTML representation of a docstring
Parameters | |
obj:model.Documentable | Undocumented |
Returns | |
Tag | Undocumented |
Undocumented
Parameters | |
errs:List[ | Undocumented |
parsedParsedDocstring | Undocumented |
ctx:model.Documentable | Undocumented |
Returns | |
Tag | Undocumented |
Format list of Field
object. Used for notes, see also, authors, etc.
Generates a 2-columns layout as follow:
+------------------------------------+ | <label> | | <desc ... > | +------------------------------------+
Parameters | |
singular:str | Undocumented |
plural:str | Undocumented |
fields:Sequence[ | Undocumented |
Returns | |
Iterator[ | Each row as iterator |
Transform a `model.DocumentableKind` Enum value to string.
Parameters | |
kind:model.DocumentableKind | Undocumented |
plural:bool | Undocumented |
Returns | |
str | Undocumented |
Generate an shortened HTML representation of a docstring.
Parameters | |
obj:model.Documentable | Undocumented |
Returns | |
Tag | Undocumented |
Undocumented
Parameters | |
errs:List[ | Undocumented |
parsedParsedDocstring | Undocumented |
ctx:model.Documentable | Undocumented |
Returns | |
Tag | Undocumented |
Generate an HTML representation for an object lacking a docstring.
Parameters | |
obj:model.Documentable | Undocumented |
Returns | |
Tag | Undocumented |
Fetch the docstring for a documentable. Treat empty docstring as undocumented.
:returns:
- (docstring, source) if the object is documented.
- (None, None) if the object has no docstring (even inherited).
- (None, source) if the object has an empty docstring.
Parameters | |
obj:model.Documentable | Undocumented |
Returns | |
Tuple[ | Undocumented |
Undocumented
Parameters | |
obj:model.Documentable | Undocumented |
Returns | |
Optional[ | Undocumented |
Get the parse_docstring(str, List[ParseError], bool) -> ParsedDocstring function.
Parameters | |
obj:model.Documentable | Undocumented |
Returns | |
Callable[ | Undocumented |
Browsers aren't smart enough to recognize word breaking opportunities in snake_case or camelCase, so this function helps them out by inserting word break opportunities.
:note: It support full dotted names and will add a wbr tag after each dot.
Parameters | |
text:str | Undocumented |
Returns | |
Flattenable | Undocumented |
Parse a docstring.
Parameters | |
obj:model.Documentable | The object we're parsing the documentation for. |
doc:str | The docstring. |
source:model.Documentable | The object on which the docstring is defined. This can differ from obj if the docstring is inherited. |
markup:Optional[ | Parse the docstring with the given markup, ignoring system's options. Useful for creating ParsedDocstring s from restructuredtext for instance. |
section:str | A custom section to use. |
Returns | |
ParsedDocstring | Undocumented |
Undocumented
Parameters | |
obj:model.Documentable | Undocumented |
errs:Sequence[ | Undocumented |
section:str | Undocumented |
Undocumented
Parameters | |
obj:model.Documentable | Undocumented |
warns:Sequence[ | Undocumented |
**kwargs:Any | Undocumented |
Wraps ParsedDocstring.to_stan()
to catch exception and handle them in fallback. This is used to convert docstrings as well as other colorized AST values to stan.
Parameters | |
parsedParsedDocstring | The ParsedDocstring to "stanify". |
linker:DocstringLinker | The DocstringLinker to use to resolve links. |
ctx:model.Documentable | The documentable context to use to report errors, passed to the fallback function. |
compact:bool | Whether the generated html should be compact. |
fallback:Callable[ | A callable that returns a fallback stan if the convertion failed. It can also be used to set some state on the documentable context. Signature: (errs:List[ParseError], doc:ParsedDocstring, ctx:model.Documentable) -> Tag |
report:bool | Whether to report errors. |
section:str | Used for error messages. |
Returns | |
Tag | Undocumented |
Ensures that the model.Documentable.parsed_summary
attribute of a documentable is set to it's final value. Do not generate summary twice.
Parameters | |
obj:model.Documentable | Undocumented |
Returns | |
Tuple[ | Tuple: source, parsed docstring |
Does this AST node represent the literal constant None?
Parameters | |
node:ast.expr | Undocumented |
Returns | |
bool | Undocumented |