class documentation
class TOCRenderer(HTMLRenderer): (source)
Extends HTMLRenderer class for table of contents support.
Parameters | |
depth | the maximum level of heading to be included in TOC; |
omit | whether to ignore tokens where token.level == 1; |
filter | when any of these functions evaluate to true, current heading will not be included; |
*extras | allows subclasses to add even more custom tokens. |
Static Method | parse |
Helper method; converts rendered heading to plain text. |
Method | __init__ |
No summary |
Method | render |
Overrides super().render_heading; stores rendered heading first, then returns it. |
Instance Variable | depth |
Undocumented |
Instance Variable | filter |
Undocumented |
Instance Variable | omit |
Undocumented |
Property | toc |
Returns table of contents as a block_token.List instance. |
Instance Variable | _headings |
Undocumented |
Inherited from HTMLRenderer
:
Static Method | escape |
This method is deprecated. Use html.escape instead. |
Static Method | escape |
Escape urls to prevent code injection craziness. (Hopefully.) |
Static Method | render |
Undocumented |
Static Method | render |
Undocumented |
Static Method | render |
Undocumented |
Static Method | render |
Undocumented |
Method | __exit__ |
Make renderer classes into context managers. |
Method | render |
Undocumented |
Method | render |
Undocumented |
Method | render |
Undocumented |
Method | render |
Undocumented |
Method | render |
Undocumented |
Method | render |
Undocumented |
Method | render |
Undocumented |
Method | render |
Undocumented |
Method | render |
Undocumented |
Method | render |
Undocumented |
Method | render |
Undocumented |
Method | render |
Undocumented |
Method | render |
Default render method for RawText. Simply return token.content. |
Method | render |
Undocumented |
Method | render |
Undocumented |
Method | render |
Undocumented |
Method | render |
Undocumented |
Method | render |
Undocumented |
Method | render |
Undocumented |
Instance Variable | _suppress |
Undocumented |
Inherited from BaseRenderer
(via HTMLRenderer
):
Method | __enter__ |
Make renderer classes into context managers. |
Method | render |
Grabs the class name from input token and finds its corresponding render function. |
Method | render |
Recursively renders child tokens. Joins the rendered strings with no space in between. |
Instance Variable | footnotes |
Undocumented |
Instance Variable | render |
maps tokens to their corresponding render functions. |
Class Method | _cls |
Undocumented |
Static Method | _tokens |
Helper method; takes a module and returns a list of all token classes specified in module.__all__. Useful when custom tokens are defined in a separate module. |
Class Variable | _parse |
Undocumented |
Instance Variable | _extras |
a list of custom tokens to be added to the parsing process. |
Parameters | |
depth | Undocumented |
omit | Undocumented |
filter | Undocumented |
*extras:list | allows subclasses to add even more custom tokens. |