# 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, as in the minimal example.

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, as in the minimal example.

class pybtex_docutils.Backend(encoding=None)

  Bases: `pybtex.backends.BaseBackend`

  RenderType

    alias of `list`

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

    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

    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

    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

    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

    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)

  Bases: `docutils.parsers.rst.Directive`