GuideCitation#
- class documenteer.citations.GuideCitation(*, citation, label=None, is_self=False, in_footer=False, note=None)#
Bases:
objectA citation a user guide displays, together with how the guide presents it.
A guide declares these in the
[[project.citations]]array ofdocumenteer.toml. The bibliographic record is theCitation; the remaining fields say where and how the guide shows it, and are set indocumenteer.tomlalone — they are never sourced from a CITATION.cff file.- Parameters:
Attributes Summary
The bibliographic record.
Whether this citation appears in the site footer.
Whether this is the DOI whose landing page this site is.
A short display label distinguishing this citation from the others, such as "Dataset" or "Paper".
Free text about when to use this citation, displayed alongside it.
Methods Summary
Express the citation as the mapping published into Sphinx's
html_context.Attributes Documentation
Whether this citation appears in the site footer.
- is_self: bool = False#
Whether this is the DOI whose landing page this site is.
At most one citation on a site is the self citation. It is the one whose metadata the site emits in its
<head>, and the one acitation-carddirective renders by default.
- label: str | None = None#
A short display label distinguishing this citation from the others, such as “Dataset” or “Paper”.
Methods Documentation
- to_html_context()#
Express the citation as the mapping published into Sphinx’s
html_context.- Returns:
A JSON-serializable mapping. Everything a template or a directive needs is precomputed here — including the
plain_textandbibtexrenderings — so that the surfaces that display a citation only read the context and never recompose it.- Return type:
Notes
The mapping is the contract between this module and every guide surface that displays a citation: the
<head>metadata, thecitation-carddirective, and the footer.A displayed citation ends in a hyperlink to the work, so the mapping carries the plain-text rendering pre-split at that location:
plain_text_leadis the citation up to it andplain_text_urlis the location itself, and concatenating the two always reproducesplain_text. Splitting it here is what lets a Jinja template render a linked citation without doing string surgery of its own, and keeps the card and the footer from ever disagreeing about where the text ends and the link begins.