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, 3/22 methods, 0/1 static method documented |
Class |
|
Undocumented |
Class |
|
Encapsulate the name of kwarg parameters in Function.annotations mapping keys. |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
Description of an exception that can be raised by function/method. |
Class |
|
Undocumented |
Class |
|
Encapsulate the name of vararg parameters in Function.annotations mapping keys. |
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 |
Returns a simplified signature of the constructor. forclass is not always the function's parent, it can be a subclass. |
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 a string representation for an object lacking a docstring. |
Function | function |
The lenght of the a function def is defnied by the lenght of it's name plus the lenght of it's signature. On top of that, a function or method that takes no argument (expect unannotated 'self' for methods, and 'cls' for classmethods) will always have a lenght equals to the function name len plus two for 'function()'. |
Function | get |
Get an extra docstring to represent Class constructors. |
Function | get |
Get a useful description about this namespace package. |
Function | get |
Undocumented |
Function | get |
Get the type of this attribute as parsed docstring. |
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 |
Get the formatted type of this attribute. |
Function | unwrap |
Unwrap the body of the given Tag instance if it has a non-empty tag name and ensure there is at least one paragraph. |
Constant | BROKEN |
Undocumented |
Constant | BROKEN |
Undocumented |
Variable | field |
Undocumented |
Class | _ |
Undocumented |
Function | _colorize |
Colorize this signature into a ParsedDocstring. |
Function | _colorize |
Returns this annotation as a list of nodes |
Function | _colorize |
Convert a single parameter to a docutils inline element. |
Function | _format |
Undocumented |
Function | _get |
Returns the docformat to use to parse the docstring of this object. |
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 |
Whether this parameter is the 'self' param of methods or 'cls' param of class methods. |
Function | _objclass |
Undocumented |
Function | _split |
Undocumented |
Function | _wrap |
Whether to wrap the given docstring stan body inside a paragraph. |
Variable | _docformat |
Undocumented |
list[ ParseError]
, doc: ParsedDocstring
, __: model.Documentable
) -> Tag
:
(source)
¶
This fallback function uses ParsedDocstring.to_node()
, so it must be used only with ParsedDocstring
subclasses that implements to_node().
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.
Returns | |
model.Documentable | None |
|
Populate Attributes for module/class variables using fields from that module/class's docstring. Must only be called for objects that have a docstring.
model.Function
, forclass: model.Class
) -> str
:
(source)
¶
Returns a simplified signature of the constructor. forclass is not always the function's parent, it can be a subclass.
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 | |
list[ | A list containing a single table tag or an empty list if no descs are provided. |
list[ ParseError]
, parsed_doc: ParsedDocstring
, ctx: model.Documentable
) -> Tag
:
(source)
¶
Undocumented
Format list of Field
object. Used for notes, see also, authors, etc.
Generates a 2-columns layout as follow:
+------------------------------------+ | <label> | | <desc ... > | +------------------------------------+
Returns | |
list[ | A list containing a single table tag or an empty list if no fields are provided. |
list[ ParseError]
, parsed_doc: ParsedDocstring
, ctx: model.Documentable
) -> Tag
:
(source)
¶
Undocumented
The lenght of the a function def is defnied by the lenght of it's name plus the lenght of it's signature. On top of that, a function or method that takes no argument (expect unannotated 'self' for methods, and 'cls' for classmethods) will always have a lenght equals to the function name len plus two for 'function()'.
model.Function | model.FunctionOverload
) -> ParsedDocstring | None
:
(source)
¶
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.
model.Documentable
, doc: str
, source: model.Documentable
, markup: str | None
= None, section: str
= 'docstring') -> ParsedDocstring
:
(source)
¶
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:str | None | 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 |
model.Documentable
, errs: Sequence[ ParseError]
, section: str
= 'docstring'):
(source)
¶
Undocumented
ParsedDocstring
, linker: DocstringLinker
, ctx: model.Documentable
, fallback: Callable[ [ list[ ParseError], ParsedDocstring, model.Documentable], Tag]
, report: bool
= True, section: str
= 'docstring') -> Tag
:
(source)
¶
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. |
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 |
Unwrap the body of the given Tag instance if it has a non-empty tag name and ensure there is at least one paragraph.
Note | |
This is the counterpart of what we're doing in But for docstrings, we want to have at least one paragraph for consistency. |
inspect.Signature
, ctx: model.Documentable
) -> ParsedDocstring
:
(source)
¶
Colorize this signature into a ParsedDocstring.
inspect.Parameter
, ctx: model.Documentable
, has_next: bool
, is_first: bool
) -> nodes.inline
:
(source)
¶
Convert a single parameter to a docutils inline element.
model.Documentable
) -> tuple[ model.Documentable | None, ParsedDocstring]
:
(source)
¶
Ensures that the model.Documentable.parsed_summary
attribute of a documentable is set to it's final value. Do not generate summary twice.
Returns | |
tuple[ | Tuple: source, parsed docstring |
Whether this parameter is the 'self' param of methods or 'cls' param of class methods.
Note | |
this does not check whether the parameter is the first of the signature. This should be done before calling this function! |