New Domains¶
Classes and methods to maintain any bibtex information that is stored outside the doctree.
- class sphinxcontrib.bibtex.domain.Citation(citation_id: str, bibliography_key: BibliographyKey, key: str, entry: Entry, formatted_entry: FormattedEntry)[source]¶
Information about a citation.
- bibliography_key: BibliographyKey¶
Key of its bibliography directive.
- entry: Entry¶
Entry from pybtex.
- formatted_entry: FormattedEntry¶
Entry as formatted by pybtex.
- class sphinxcontrib.bibtex.domain.SphinxReferenceInfo(builder: Builder, fromdocname: str, todocname: str, citation_id: str, title: str)[source]¶
Tuple containing reference info to enable sphinx to resolve a reference to a citation.
- builder: Builder¶
The Sphinx builder.
- class sphinxcontrib.bibtex.domain.SphinxReferenceText(info: sphinxcontrib.bibtex.richtext.ReferenceInfo, *parts: pybtex.richtext.BaseText)[source]¶
Pybtex rich text class for citation references with the docutils backend, for use with
SphinxReferenceInfo
.
- class sphinxcontrib.bibtex.domain.BibtexDomain(env: BuildEnvironment)[source]¶
Sphinx domain for the bibtex extension.
- property bibdata: sphinxcontrib.bibtex.bibfile.BibData¶
Information about the bibliography files.
- property bibliographies: Dict[BibliographyKey, BibliographyValue]¶
Map storing information about each bibliography directive.
- property citation_refs: List[CitationRef]¶
Citation reference data.
- property citations: List[sphinxcontrib.bibtex.domain.Citation]¶
Citation data.
- clear_doc(docname: str) None [source]¶
Remove traces of a document in the domain-specific inventories.
- get_all_cited_keys(docnames)[source]¶
Yield all citation keys for given docnames in order, then ordered by citation order.
- get_entries(bibfiles: List[str]) Iterable[Entry] [source]¶
Return all bibliography entries from the bib files, unsorted (i.e. in order of appearance in the bib files.
- get_filtered_entries(bibliography_key: BibliographyKey) Iterable[Tuple[str, Entry]] [source]¶
Return unsorted bibliography entries filtered by the filter expression.
- get_formatted_entries(bibliography_key: BibliographyKey, docnames: List[str]) Iterable[Tuple[Entry, FormattedEntry]] [source]¶
Get sorted bibliography entries along with their pybtex labels, with additional sorting and formatting applied from the pybtex style.
- get_sorted_entries(bibliography_key: BibliographyKey, docnames: List[str]) Iterable[Tuple[str, Entry]] [source]¶
Return filtered bibliography entries sorted by citation order.
- merge_domaindata(docnames: List[str], otherdata: Dict) None [source]¶
Merge in data regarding docnames from a different domaindata inventory (coming from a subprocess in parallel builds).
- resolve_any_xref(env: BuildEnvironment, fromdocname: str, builder: Builder, target: str, node: pending_xref, contnode: docutils.nodes.Element) List[Tuple[str, docutils.nodes.Element]] [source]¶
Replace node by list of citation references (one for each key), provided that the target has citation keys.
Domain for footnote citations.
- class sphinxcontrib.bibtex.foot_domain.BibtexFootDomain(env: BuildEnvironment)[source]¶
Sphinx domain for footnote citations.
- merge_domaindata(docnames: List[str], otherdata: Dict) None [source]¶
Merge in data regarding docnames from domain data inventory otherdata.
As there is no document specific data for this domain, this function does nothing.
- resolve_any_xref(env: BuildEnvironment, fromdocname: str, builder: Builder, target: str, node: pending_xref, contnode: docutils.nodes.Element) List[Tuple[str, docutils.nodes.Element]] [source]¶
Resolve the pending reference node with the given target, where the reference comes from an “any” role.
Since citation references are resolved to regular citations, and not to footnote citations, this implementation simply returns an empty list.