Skip to main content

Module render

Module render 

Source
Expand description

Citation renderers for stored Metadata — BibTeX and CSL JSON 1.0.

Phase 2 / Slice 15b. The rendering logic originally lived in the doiget-cli bib / csl subcommands; it is hoisted here so the doiget-mcp doiget_bibtex_export / doiget_csl_export tools and the CLI share a single implementation (docs/MCP_TOOLS.md §1 rows doiget_bibtex_export / doiget_csl_export).

Both renderers are pure functions of a Metadata plus a citation key (the entry’s safekey). No I/O, no network. They emit the Phase 1 binding fields from docs/STORE.md §2 (title, authors, year, doi, venue, publisher, issn); richer entry-type / field mapping is a Phase 2 follow-up.

Functions§

to_bibtex
Render a single BibTeX entry for m, keyed by citation_key.
to_bibtex_with_fields
to_bibtex with extra fields appended after the ones the metadata supplies, in order – e.g. ("file", "refs/fock1930.pdf") (#610). Values get the same brace and markup scrubbing as every other field.
to_csl_array
Render m as a CSL JSON 1.0 array (a single-element array, so it is a drop-in for citeproc-js / pandoc --csl-json consumers that expect a list of items), keyed by citation_key.
to_csl_array_with
to_csl_array, adding container-title-short from [doiget].short_venue when short_container is set and the record carried an abbreviation (#611).