Expand description
Lower #bibliography(...) directives into a semantic node.
This is the source boundary only (manifest Β§4, MVP 4): the directive
declares one bibliography database path, which is resolved relative to
the current .mos source file and stashed on a
[NodeKind::Bibliography] node. After lowering, citation keys are checked
against the parsed BibTeX records from those declared sources. Rendering
citation markers and bibliography entries is still a later slice.
Diagnostics:
MOS0040:#bibliography(...)called without a (non-empty) path.MOS0042:#bibliography(...)declared more than one path; first wins.MOS0020: the path argument is present but not a string.MOS0015: an unknown keyword argument was supplied.MOS0041: the resolved path does not point to a file on disk (a warning; the node is still emitted with its resolved path).MOS0045: a citation key does not exist in a complete parsed bibliography set.MOS0046: a citation key appears in more than one declared bibliography source.
StructsΒ§
- Bibliography
Origin π - Loaded
Bibliography π
FunctionsΒ§
- bibliography_
path π - Pull the single source path out of the directive arguments. A leading
positional string (
#bibliography("refs.bib")) or the namedpath:/src:forms are accepted, mirroring#image(...). ReturnsNone(after emitting a diagnostic) when the path is missing, empty, or not a string. - citation_
key_ πspan - edit_
distance π - is_
citation_ πkey - load_
bibliography π - lower_
bibliography_ πdirective - Lower a top-level
#bibliography("refs.bib")directive into a single [NodeKind::Bibliography] node hanging off the document root. The literal path is recorded undersrc; the path resolved against the source fileβs directory is recorded underresolved_pathso the later BibTeX reader can open the database without re-deriving the location. - nearest_
citation_ πkey - resolve_
citations π - Load every declared bibliography source, mark citation nodes whose keys
exist in any parsed record set, and rewrite their visible text to a
numeric label assigned by first-use order. Unknown citation keys emit
MOS0045once per citation node and keep their[?key?]placeholder.