Pybtex Extensions¶
New Text Elements¶
- class sphinxcontrib.bibtex.richtext.BaseReferenceText(info: ReferenceInfo, *parts: BaseText)[源代码]¶
Generic rich text element for citation references. Instances store some extra reference info that can be used when formatting. This base class renders its children without further formatting. Implementations must create a derivation from this class which overrides the render method to create the desired output. See for instance
SphinxReferenceText
.
- class sphinxcontrib.bibtex.richtext.ReferenceInfo¶
Generic type parameter for types that store reference information. To be implemented by clients. See for instance
SphinxReferenceInfo
.TypeVar('ReferenceInfo') 的别名
New Template Nodes¶
- sphinxcontrib.bibtex.style.template.join(sep='', sep2=None, last_sep=None, other=None)[源代码]¶
Join text fragments together.
- sphinxcontrib.bibtex.style.template.sentence(capfirst=False, capitalize=False, add_period=True, sep=', ', sep2=None, last_sep=None, other=None)[源代码]¶
Join text fragments, capitalize the first letter, and add a period to the end.
- sphinxcontrib.bibtex.style.template.names(role, sep='', sep2=None, last_sep=None, other=None)[源代码]¶
Return formatted names.
- sphinxcontrib.bibtex.style.template.entry_label()¶
Node for inserting the label of a formatted entry.
- sphinxcontrib.bibtex.style.template.reference()¶
Pybtex node for inserting a docutils reference node to a citation. The children of the node comprise the content of the reference, and any referencing information is stored in the reference_info key of the data. The data must also contain a style key pointing to the corresponding
BaseReferenceStyle
.
- sphinxcontrib.bibtex.style.template.footnote_reference()¶
Pybtex node for inserting a footnote_reference docutils node. Any referencing information is stored in the reference_info key of the data. The data must also contain a style key pointing to the corresponding
BaseReferenceStyle
.
- class sphinxcontrib.bibtex.style.template.FootReferenceInfo(key: str, document: docutils.nodes.document, refname: str)[源代码]¶
Tuple containing reference info to enable sphinx to resolve a footnote reference.
- document: document¶
Current docutils document.
- class sphinxcontrib.bibtex.style.template.FootReferenceText(info: ReferenceInfo, *parts: BaseText)[源代码]¶
Pybtex rich text class generating a docutils footnote_reference node to a citation for use with
FootReferenceInfo
.
- class sphinxcontrib.bibtex.style.template.SphinxReferenceInfo(builder: Builder, fromdocname: str, todocname: str, citation_id: str, title: str, pre_text: str, post_text: str)[源代码]¶
Tuple containing reference info to enable sphinx to resolve a reference to a citation.
- builder: Builder¶
The Sphinx builder.
- class sphinxcontrib.bibtex.style.template.SphinxReferenceText(info: ReferenceInfo, *parts: BaseText)[源代码]¶
Pybtex rich text class generating a docutils reference node to a citation for use with
SphinxReferenceInfo
.