Miscellaneous utilities for the documentation utilities.
Module | code |
Lexical analysis of formal languages (i.e. code) using Pygments. |
Module | error |
Deprecated module to handle Exceptions across Python versions. |
Package | math |
This is the Docutils (Python Documentation Utilities) "math" sub-package. |
Module | punctuation |
No module docstring; 1/5 variable, 1/1 function documented |
Module | roman |
Convert to and from Roman numerals |
Module | smartquotes |
========================= Smart Quotes for Docutils ========================= |
Module | urischemes |
`schemes` is a dictionary with lowercase URI addressing schemes as keys and descriptions as values. It was compiled from the index at http://www.iana.org/assignments/uri-schemes (revised 2005-11-28) and an older list at https://www... |
From __init__.py
:
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
List of dependencies, with file recording support. |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
Info/warning/error reporter and ``system_message`` element generator. |
Class |
|
Undocumented |
Class |
|
Undocumented |
Function | assemble |
Return a mapping of option names to values. |
Function | clean |
Undocumented |
Function | column |
Indices of Unicode string `text` when skipping combining characters. |
Function | column |
Return the column width of text. |
Function | decode |
Ensure `path` is Unicode. Return `str` instance. |
Function | escape2null |
Return a string with escape-backslashes converted to nulls. |
Function | extract |
Return a dictionary mapping extension option names to converted values. |
Function | extract |
Return a list of (name, value) from a line of the form "name=value ...". |
Function | extract |
Return a list of option (name, value) pairs from field names & bodies. |
Function | find |
Return indices of all combining chars in Unicode string `text`. |
Function | find |
Search for `path` in the list of directories `dirs`. |
Function | get |
Return the "source" and "line" attributes from the `node` given or from its closest ancestor. |
Function | get |
Retrieve list of stylesheet references from the settings object. |
Function | get |
Retrieve a stylesheet reference from the settings object. |
Function | get |
Return whether or not to trim footnote space. |
Function | new |
Return a new empty document object. |
Function | new |
Return a new Reporter object. |
Function | normalize |
Return a list of normalized combinations for a `BCP 47` language tag. |
Function | relative |
Build and return a path to `target`, relative to `source` (both files). |
Function | split |
Split `text` on escaped whitespace (null+space or null+newline). Return a list of strings. |
Function | strip |
Undocumented |
Function | uniq |
Undocumented |
Function | version |
Return a version identifier string built from `version_info`, a `docutils.VersionInfo` namedtuple instance or compatible tuple. If `version_info` is not provided, by default return a version identifier string based on `docutils... |
Variable | east |
Mapping of result codes from `unicodedata.east_asian_widt()` to character column widths. |
Variable | release |
Undocumented |
Return a dictionary mapping extension option names to converted values. :Parameters: - `field_list`: A flat field list without field arguments, where each field body consists of a single paragraph only. - `options_spec`: Dictionary mapping known option names to a conversion function such as `int` or `float`. :Exceptions: - `KeyError` for unknown option names. - `ValueError` for invalid option values (raised by the conversion function). - `TypeError` for invalid option value types (raised by conversion function). - `DuplicateOptionError` for duplicate options. - `BadOptionError` for invalid fields. - `BadOptionDataError` for invalid option data (missing name, missing data, bad quotes, etc.).
Return a list of option (name, value) pairs from field names & bodies. :Parameter: `field_list`: A flat field list, where each field name is a single word and each field body consists of a single paragraph only. :Exceptions: - `BadOptionError` for invalid fields. - `BadOptionDataError` for invalid option data (missing name, missing data, bad quotes, etc.).
Return a mapping of option names to values. :Parameters: - `option_list`: A list of (name, value) pairs (the output of `extract_options()`). - `options_spec`: Dictionary mapping known option names to a conversion function such as `int` or `float`. :Exceptions: - `KeyError` for unknown option names. - `DuplicateOptionError` for duplicate options. - `ValueError` for invalid option values (raised by conversion function). - `TypeError` for invalid option value types (raised by conversion function).
Ensure `path` is Unicode. Return `str` instance. Decode file/path string in a failsafe manner if not already done.
Return a list of (name, value) from a line of the form "name=value ...". :Exception: `NameValueError` for invalid input (missing name, missing data, bad quotes, etc.).
Return a new Reporter object. :Parameters: `source` : string The path to or description of the source text of the document. `settings` : optparse.Values object Runtime settings.
Return a new empty document object. :Parameters: `source_path` : string The path to or description of the source text of the document. `settings` : optparse.Values object Runtime settings. If none are provided, a default core set will be used. If you will use the document object with any Docutils components, you must provide their default settings as well. For example, if parsing rST, at least provide the rst-parser settings, obtainable as follows: Defaults for parser component:: settings = docutils.frontend.get_default_settings( docutils.parsers.rst.Parser) Defaults and configuration file customizations:: settings = docutils.core.Publisher( parser=docutils.parsers.rst.Parser).get_settings()
Build and return a path to `target`, relative to `source` (both files). If there is no common prefix, return the absolute path to `target`.
Retrieve a stylesheet reference from the settings object. Deprecated. Use get_stylesheet_list() instead to enable specification of multiple stylesheets as a comma-separated list.
Search for `path` in the list of directories `dirs`. Return the first expansion that matches an existing file.
Return whether or not to trim footnote space. If trim_footnote_reference_space is not None, return it. If trim_footnote_reference_space is None, return False unless the footnote reference style is 'superscript'.
Return indices of all combining chars in Unicode string `text`. >>> from docutils.utils import find_combining_chars >>> find_combining_chars('A t̆ab̆lĕ') [3, 6, 9]
Indices of Unicode string `text` when skipping combining characters. >>> from docutils.utils import column_indices >>> column_indices('A t̆ab̆lĕ') [0, 1, 2, 4, 5, 7, 8]
Return the column width of text. Correct ``len(text)`` for wide East Asian and combining Unicode chars.
Return a list of normalized combinations for a `BCP 47` language tag. Example: >>> from docutils.utils import normalize_language_tag >>> normalize_language_tag('de_AT-1901') ['de-at-1901', 'de-at', 'de-1901', 'de'] >>> normalize_language_tag('de-CH-x_altquot') ['de-ch-x-altquot', 'de-ch', 'de-x-altquot', 'de']