Cached Information

Classes and methods to maintain any information that is stored outside the doctree.

class sphinxcontrib.bibtex.cache.Cache[source]

Global bibtex extension information cache. Stored in app.env.bibtex_cache, so must be picklable.

bibfiles

A dict mapping .bib file names (relative to the top source folder) to BibfileCache instances.

bibliographies

Each bibliography directive is assigned an id of the form bibtex-bibliography-xxx. This dict maps each such id to information about the bibliography directive, BibliographyCache. We need to store this extra information separately because it cannot be stored in the bibliography nodes themselves.

_cited

A dict mapping each docname to a set of citation keys.

_enum_count

A dict mapping each docname to an int representing the current bibliography enumeration counter.

add_cited(key, docname)[source]

Add the given key to the set of cited keys for docname.

Parameters:
  • key (str) – The citation key.
  • docname (str) – The document name.
get_label_from_key(key)[source]

Return label for the given key.

is_cited(key)[source]

Return whether the given key is cited in any document.

Parameters:key (str) – The citation key.
purge(docname)[source]

Remove all information related to docname.

Parameters:docname (str) – The document name.
class sphinxcontrib.bibtex.cache.BibfileCache(mtime=None, data=None)[source]

Contains information about a parsed .bib file.

mtime

A float representing the modification time of the .bib file when it was last parsed.

data

A pybtex.database.BibliographyData containing the parsed .bib file.

class sphinxcontrib.bibtex.cache.BibliographyCache(docname=None, bibfiles=None, cite='cited', style=None, list_='citation', enumtype='arabic', start=1, labels=None, encoding=None, curly_bracket_strip=True, labelprefix='')[source]

Contains information about a bibliography directive.

docname

A str containing the name of the document in which the directive occurs. We need this information during the Sphinx event env-purge-doc.

bibfiles

A list of strs containing the .bib file names (relative to the top source folder) that contain the references.

cite

A str. Should be one of:

"cited"
Only generate cited references.
"notcited"
Only generated non-cited references.
"all"
Generate all references from the .bib files.
style

The bibtex style.

list_

The list type.

enumtype

The sequence type (only used for enumerated lists).

start

The first ordinal of the sequence (only used for enumerated lists).

labels

Maps citation keys to their final labels.

labelprefix

This bibliography’s string prefix for pybtex generated labels.

Project Versions

Previous topic

New Doctree Transforms

Next topic

Changes

This Page