This is not meant as an exhaustive list, but rather to cover the primary entry points in the WikklyText modules.
WikklyText_to_XML
This is probably the best entry point for your own code to use. It converts a wikitext string into XML markup, ready for processing into whatever final format you choose.
from wikklytext import WikklyText_to_XML
(xml,context) = WikklyText_to_XML(content, encoding, safe_mode,
setvars=None, max_runtime=-1,
url_resolver=None, tree_posthook=None)
Inputs:
- content
- Wikitext (Unicode), usually from wikklytext.base.load_wikitext().
- encoding
- Desired output encoding (i.e. 'utf-8')
- safe_mode
- True/False, whether to use Safe mode.
- setvars
- Variables to set into WikContext, as dict of: name: str, unicode or int 'name' can have a leading '$' to set sysvars.
- max_runtime
- Maximum time (in seconds) to run, or -1 for unlimited.
- url_resolver
- URL resolver, see wikklytext.base for info.
- tree_posthook
- Hook to call after ElementTree is complete, before generating XML. Will be called as:
tree_posthook(rootnode, context)
Hook should modify tree in-place.
- Returns:
- (xml, context)
Where: - xml
- Generated XML as an encoded bytestring
- context
- WikContext that was used, in case user wants to inspect it.