API

The backend renders pybtex.richtext.Text instances into a list of docutils.nodes.Node instances. For typical use cases, all you need to care about are the methods Backend.paragraph(), Backend.citation(), and Backend.citation_reference() which are to be called on formatted entries.

Unless you are subclassing Backend to create a new backend, you should normally not import the pybtex_docutils module directly. Instead, use pybtex’s plugin system to get the Backend class.

class pybtex_docutils.Backend(encoding=None)[source]

Bases: pybtex.backends.BaseBackend

RenderType

alias of builtins.list

citation(entry: FormattedEntry, document: docutils.nodes.document, use_key_as_label=True) → docutils.nodes.citation[source]

Return citation node, with key as name, label as first child, and paragraph with entry text as second child. The citation is expected to be inserted into document prior to any docutils transforms.

citation_reference(entry: FormattedEntry, document: docutils.nodes.document, use_key_as_label=True) → docutils.nodes.citation_reference[source]

Return citation_reference node to the given citation. The citation_reference is expected to be inserted into document prior to any docutils transforms.

footnote(entry: FormattedEntry, document: docutils.nodes.document) → docutils.nodes.footnote[source]

Return footnote node, with key as name, and paragraph with entry text as child. The footnote is expected to be inserted into document prior to any docutils transforms.

New in version 0.2.2.

footnote_reference(entry: FormattedEntry, document: docutils.nodes.document) → docutils.nodes.footnote_reference[source]

Return footnote_reference node to the given citation. The footnote_reference is expected to be inserted into document prior to any docutils transforms.

New in version 0.2.2.

paragraph(entry: FormattedEntry) → docutils.nodes.paragraph[source]

Return a docutils.nodes.paragraph containing the rendered text for entry (without label).

New in version 0.2.0.

class pybtex_docutils.SimpleBibliography(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]

Bases: docutils.parsers.rst.Directive