lib.utils
¶
Docutils util functions and regexes.
Some stuff is ported from sphinx:
explicit_title_re, ws_re, set_role_source_info, split_explicit_title
- django_docutils.lib.utils.split_explicit_title(text)[source]¶
Split role content into title and target, if given (from sphinx).
- django_docutils.lib.utils.chop_after_docinfo(source)[source]¶
Return the source of a document after DocInfo metadata.
- django_docutils.lib.utils.chop_after_title(source)[source]¶
Return the source of a document after document title.
- django_docutils.lib.utils.chop_after_heading_smartly(source)[source]¶
Return the content after subtitle, or, if exists, docinfo.
This is a universal chop that can be used whether a document has docinfo, a title, subtitle, or not. Traditionally, directory-style RST fixtures keep metadata inside a JSON file instead of docinfo, so
chop_after_docinfo()
wouldn’t work.