lib.publisher¶
Docutils Publisher fors for Django Docutils.
-
django_docutils.lib.publisher.publish_parts_from_doctree(document, destination_path=None, writer=None, writer_name='pseudoxml', settings=None, settings_spec=None, settings_overrides=None, config_section=None, enable_exit_status=False)¶
Render docutils doctree into docutils parts.
-
django_docutils.lib.publisher.publish_toc_from_doctree(doctree, writer=None)¶
Publish table of contents from docutils doctree.
-
django_docutils.lib.publisher.publish_doctree(source, settings_overrides={})¶
Split off ability to get doctree (a.k.a. document).
It’s valuable to be able to run transforms to alter and most importantly, extract data like post abstracts.
- Parameters:
source (str or bytes) – RST content
settings_overrides (dict) – Settings overrides for docutils
- Returns:
document/doctree for reStructuredText content
- Return type:
docutils.nodes.document
-
class django_docutils.lib.publisher.PublishHtmlDocTreeKwargs¶
Bases:
TypedDictKeyword arguments accepted by publish_html_from_source.
-
django_docutils.lib.publisher.publish_html_from_source(source, **kwargs)¶
Return HTML from reStructuredText source string.
- Parameters:
source (str)
kwargs (Unpack[PublishHtmlDocTreeKwargs])
- Return type:
-
django_docutils.lib.publisher.publish_html_from_doctree(doctree, show_title=True, toc_only=False)¶
Return HTML from reStructuredText document (doctree).