Expand description
Bibliography input adapters per ADR-0030.
Parses three input shapes into an iterator of Refs with optional
entry_key provenance back to the source bibliography:
- Plain refs: one
doi:…/arxiv:…/ bare-DOI / bare-arXiv id per line, with#-prefixed comments and blank lines tolerated. The existingdoiget batch <refs.txt>shape. - CSL-JSON: a JSON array of entries with
id(citation key),DOI, and optionallyarchivePrefix = "arXiv"+eprintfields. Parsed via the workspace’s existingserde_json— no new dependency. - BibTeX / BibLaTeX (.bib): deferred to a follow-up slice (the
biblatexcrate adds cargo-vet exemption churn that is independent of the slice 1 wire shape; users with a.biblibrary can re-export it as CSL-JSON from Zotero today).
Identifier-pick priority per ADR-0030 D3: doi > arxiv > pmid
(PMID adapter parking until the Ref::Pmid variant lands in a
later slice; current code carries the rule through without
producing a Pmid ref).
Parse-error policy per ADR-0030 D5: a single entry’s failure is
captured per-entry and does NOT abort the whole batch. The caller
decides whether to skip-and-warn (default) or fail-closed
(--strict).
Structs§
- Parsed
Entry - One successfully-parsed bibliography entry.
Enums§
- Format
- Input-shape discriminator per ADR-0030 D4.
- Parse
Error - Why a single bibliography entry failed to produce a
Ref.
Functions§
- detect_
format - Detect the input format per ADR-0030 D4.
- parse_
csl_ json - Parse a CSL-JSON document — a JSON array of objects, each with at
least an
id(citation key) and one ofDOI, orarchivePrefix - parse_
input - Parse
textperformat, dispatching to the matching shape parser.pathis consulted only whenformat == Format::Autoto drivedetect_format. - parse_
plain_ refs - Parse plain refs — the existing batch input format. One ref per
non-blank, non-comment line.
entry_keyis alwaysNonefor this shape; plain refs have no citation-key concept.