Expand description
Citation Style Language serde types and implementations.
This targets CSL 1.0.2 but may not support the entire specification.
At the moment, only CSL-JSON items are covered.
The top level API mimics serde_json’s:
let csl = citeworks_csl::from_str(r#"
[{
"id": "example-id",
"type": "report",
"author": [
{"given": "Jane", "family": "Roe"},
{"literal": "John Doe"}
]
}]
"#).unwrap();
assert_eq!(csl[0].author[0].given, Some("Jane".into()));Re-exports§
pub use items::Item;
Modules§
- dates
- Types and utilities for dates complex values.
- items
- Types and utilities for bibliography items.
- names
- Types and utilities for names complex values.
- ordinaries
- Types and utilities for ordinary values.
Functions§
- from_
reader - Deserialize CSL items from an IO stream of JSON.
- from_
slice - Deserialize CSL items from bytes of JSON text.
- from_
str - Deserialize CSL items from a string of JSON text.
- to_
string - Serialize the given CSL items as a String of JSON.
- to_
string_ pretty - Serialize the given CSL items as a pretty-printed String of JSON.
- to_vec
- Serialize the given CSL items as a JSON byte vector.
- to_
vec_ pretty - Serialize the given CSL items as a pretty-printed JSON byte vector.
- to_
writer - Serialize the given CSL items as JSON into the IO stream.
- to_
writer_ pretty - Serialize the given CSL items as pretty-printed JSON into the IO stream.
Type Aliases§
- Result
- Alias for a
Resultwith the error typeserde_json::Error.