Crate citeworks_csl
source · [−]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
Types and utilities for dates complex values.
Types and utilities for bibliography items.
Types and utilities for names complex values.
Types and utilities for ordinary values.
Functions
Deserialize CSL items from an IO stream of JSON.
Deserialize CSL items from bytes of JSON text.
Deserialize CSL items from a string of JSON text.
Serialize the given CSL items as a String of JSON.
Serialize the given CSL items as a pretty-printed String of JSON.
Serialize the given CSL items as a JSON byte vector.
Serialize the given CSL items as a pretty-printed JSON byte vector.
Serialize the given CSL items as JSON into the IO stream.
Serialize the given CSL items as pretty-printed JSON into the IO stream.
Type Definitions
Alias for a Result
with the error type serde_json::Error
.