class Dumper(DumperClass): (source)
Undocumented
Method | dump |
Format a parsetree to text @param tree: a parse tree object that supports a visit() method @returns: a list of lines |
Method | dump_anchor |
Undocumented |
Method | dump_block |
Undocumented |
Method | dump_h |
Undocumented |
Method | dump_img |
Undocumented |
Method | dump_li |
Undocumented |
Method | dump_line |
Undocumented |
Method | dump_link |
Undocumented |
Method | dump_object |
Dumps objects defined by InsertedObjectType |
Method | dump_object_fallback |
Method to serialize objects that do not have their own handler for this format. @implementation: must be implemented in sub-classes |
Method | dump_ol |
Undocumented |
Method | dump_table |
Undocumented |
Method | dump_td |
Undocumented |
Method | dump_th |
Undocumented |
Method | dump_thead |
Undocumented |
Method | dump_trow |
Undocumented |
Method | encode_text |
Optional method to encode text elements in the output |
Method | text |
Append text @param text: text to be appended as string @implementation: optional for subclasses |
Constant | TAGS |
Undocumented |
Constant | TEMPLATE_OPTIONS |
Undocumented |
Method | _strip_newline |
Undocumented |
Instance Variable | _isrtl |
Undocumented |
Inherited from DumperClass
:
Method | __init__ |
Undocumented |
Method | append |
Convenience function to open a tag, append text and close it immediatly. |
Method | end |
No summary |
Method | get_lines |
Return the dumped content as a list of lines Should only be called after closing the top level element |
Method | isrtl |
No summary |
Method | prefix_lines |
No summary |
Method | start |
Start formatted region |
Instance Variable | context |
the stack of open tags maintained by this class. Can be used in dump_ methods to inspect the parent scope of the format. Elements on this stack have "tag", "attrib" and "text" attributes. Keep in mind that the parent scope is not yet complete when a tag is serialized. |
Instance Variable | linker |
the (optional) Linker object, used to resolve links |
Instance Variable | template_options |
a ConfigDict with options that may be set in a template (so inherently not safe !) to control the output style. Formats using this need to define the supported keys in the dict TEMPLATE_OPTIONS. |
Instance Variable | _text |
Undocumented |
zim.formats.DumperClass.dump
Parameters | |
tree | a parse tree object that supports a visit() method |
Returns | |
a list of lines |
Unknown Field: implementation | |
must be implemented in sub-classes |
zim.formats.DumperClass.encode_text
Parameters | |
tag | formatting tag |
text | text to be encoded |
Returns | |
encoded text | |
Note | |
Do not apply text encoding in the dump_ methods, the list of strings given there may contain prefix and postfix formatting of nested tags. | |
Unknown Field: implementation | |
optional, default just returns unmodified input |
zim.formats.DumperClass.text
Parameters | |
text | text to be appended as string |
Unknown Field: implementation | |
optional for subclasses |
zim.formats.DumperClass.TEMPLATE_OPTIONS
Undocumented
Value |
|