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): parsed via the
biblatexcrate (ADR-0030 D2). One@entrytype{KEY, …}per entry; thedoifield is preferred, falling back to an arXiveprint.
Identifier-pick priority per ADR-0030 D3: doi > arxiv > pmid.
A PMID / PMCID entry is reported here as UnsupportedIdentifier and
turned into the DOI PubMed lists for it by
crate::pubmed::resolve_entries (#500, ADR-0061) – a request, so
not in this pure parser. There is no Ref::Pmid: the DOI is the
identity.
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_
bibtex - Parse a BibTeX / BibLaTeX document via the
biblatexcrate (ADR-0030 D2). One@entrytype{KEY, …}produces one entry;entry_keyis the citation key verbatim. - 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. - unsupported_
identifier_ claim - The claim
ParseError::UnsupportedIdentifiermakes, without theentry {entry_key:?}prefix itsDisplaycarries.