documenteer.citations#

documenteer.citations Module#

Composition of bibliographic citations for Documenteer-built sites.

Documenteer renders citations in several places — a technote’s “Citing this document” section and BibTeX copy control, a user guide’s citation card and footer — and every one of them composes the same bibliographic record. This module is the single implementation those surfaces share: a Citation value object with to_plain_text and to_bibtex composers, the identifier normalizers that give every DOI, ORCID, and ROR in Documenteer the same spelling, and the schema.org JSON-LD composers that make a guide — and, for a site that registers a page per work, each of those pages — a machine-readable DOI landing page.

Composition is local and deterministic. Nothing here touches the network, so the same metadata always yields byte-identical output during a Sphinx build.

Functions#

compose_highwire_tags(citation, *[, url])

Compose one citation as the Highwire <meta> tags a page carries in its <head>, escaped and ready to emit.

compose_landing_page_jsonld(citations, *[, ...])

Compose a site's citations as a schema.org JSON-LD document, serialized ready to embed in a <script type="application/ld+json"> element.

compose_page_jsonld(citations, *[, ...])

Compose the citations that claim one page as that page's own schema.org JSON-LD document, serialized ready to embed in a <script type="application/ld+json"> element.

describe_citation(citation, citations, *[, ...])

Name one citation in a build warning, so that a reader can tell which of a site's entries it is about.

doi_url(doi)

Express a DOI as a resolvable https://doi.org URL.

normalize_bibtex_key(value)

Validate a BibTeX citation key, returning it stripped of surrounding whitespace.

normalize_citation_url(value, *[, field])

Normalize a citation's landing-page URL, rejecting one that could not be linked.

normalize_doi(value)

Normalize a DOI into its bare form, 10.NNNN/suffix.

normalize_orcid(value)

Reduce an ORCID URL to its bare identifier.

orcid_url(value)

Express an ORCID as a resolvable https://orcid.org URL.

page_landing_url(citation, page_url)

Locate a page-claiming citation on the page it claims: the page's URL with that citation's own fragment appended.

ror_url(value)

Express a ROR identifier as a resolvable https://ror.org URL.

Classes#

BibtexEntryType(*values)

The BibTeX entry type to compose a citation as.

Citation(*, title[, type, doi, authors, ...])

A bibliographic citation for a work, composable as plain text or BibTeX.

CitationType(*values)

The kind of work a citation describes.

GuideCitation(*, citation[, label, is_self, ...])

A citation a user guide displays, together with how the guide presents it.

OrganizationAuthor(*, name[, ror])

An organization credited as an author of a cited work.

PartialDate(year[, month, day])

A publication date stated to the precision its source knows.

PersonAuthor(*, family_name[, given_name, ...])

A person credited as an author of a cited work.

Class Inheritance Diagram#

Inheritance diagram of documenteer.citations.BibtexEntryType, documenteer.citations.Citation, documenteer.citations.CitationType, documenteer.citations.GuideCitation, documenteer.citations.OrganizationAuthor, documenteer.citations.PartialDate, documenteer.citations.PersonAuthor