mos_csl/lib.rs
1//! Citation Style Language (CSL) support for Mosaic (manifest §12).
2//!
3//! This crate provides the **data foundations** for CSL 1.0.2; not a CSL
4//! processor. It ships:
5//!
6//! - a typed **item data model** ([`Item`] with the [`ItemType`] and variable
7//! vocabularies) mirroring the CSL-JSON shape a style formats;
8//! - an infallible **BibTeX → CSL mapping** ([`item_from_bib_entry`],
9//! [`library_from_bibliography`]) from `mos-bib` records; and
10//! - a **CSL XML style parser** ([`parse_style`]) producing a typed [`Style`]
11//! AST (`<style>` / `<info>` / `<citation>` / `<bibliography>` / `<macro>`
12//! and the rendering elements).
13//!
14//! Out of scope: the CSL **processor** itself: evaluating a style against
15//! items to render citations or bibliographies (formatting, sorting,
16//! disambiguation, name ordering, locales). This crate has no
17//! `mos-eval` / layout / PDF wiring.
18
19#![doc(
20 html_logo_url = "https://mosaic.kjanat.dev/assets/A4.svg",
21 html_favicon_url = "https://mosaic.kjanat.dev/assets/A4.svg"
22)]
23
24mod error;
25mod from_bibtex;
26mod item;
27mod parser;
28mod style;
29
30pub use error::{CslParseError, CslParseErrorKind};
31pub use from_bibtex::{item_from_bib_entry, library_from_bibliography};
32pub use item::{
33 Date, DateParts, DateVariable, Item, ItemType, Name, NameVariable, NumberVariable,
34 StandardVariable,
35};
36pub use parser::parse_style;
37pub use style::{
38 Bibliography, Branch, Choose, Citation, Common, Conditions, DateElement, DatePart, Element,
39 EtAl, Group, Info, Label, Layout, Match, NameElement, Names, Number, SortKey, SortTarget,
40 Style, StyleClass, Text, TextSource,
41};