Crate citeworks_csl

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§

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 Result with the error type serde_json::Error.