Skip to main content

Module from_bibtex

Module from_bibtex 

Source
Expand description

Map parsed BibTeX records ([mos_bib::BibEntry]) into CSL Items.

This is a best-effort, infallible mapping: BibTeX entry types become the closest CSL ItemType (unknown โ†’ ItemType::Document), and recognised BibTeX fields become CSL variables. Unrecognised fields are dropped, as CSL processors do.

Name handling is intentionally minimal: author/editor are split on whitespace-delimited and tokens, and per name a Last, First comma form or First Last form becomes family/given. Single-token names are kept as a literal. Full BibTeX name parsing (protected institutional names, von/Jr particles) and month handling are future refinements.

Functionsยง

apply_field ๐Ÿ”’
Place one recognised BibTeX field onto the item; drop unknown fields.
is_conference_entry ๐Ÿ”’
is_name_separator ๐Ÿ”’
is_report_entry ๐Ÿ”’
item_from_bib_entry
Map one BibTeX entry to a CSL Item.
item_type_for ๐Ÿ”’
BibTeX entry type (already lowercased by mos-bib) โ†’ closest CSL type.
library_from_bibliography
Map a whole [Bibliography] to CSL items keyed by citation key.
parse_name_without_comma ๐Ÿ”’
parse_names ๐Ÿ”’
Split a BibTeX name list on whitespace-delimited and tokens.
parse_one_name ๐Ÿ”’
Last, First and First Last forms become family/given; single-token names stay literal because mos-bib does not preserve institutional bracing yet.
parse_year ๐Ÿ”’
Parse a BibTeX year into an issued Date; a non-numeric year is kept as a literal.
push_name ๐Ÿ”’