ezu_style/lib.rs
1//! Ezu Style Spec — declarative style specification for painterly map
2//! rendering.
3//!
4//! Parsing this crate produces a [`Document`] — a pure data structure,
5//! not an evaluator. To execute it, feed the document to
6//! `ezu-graph::build_graph` with a `NodeRegistry`.
7//!
8//! ```no_run
9//! let json = std::fs::read_to_string("watercolor.json").unwrap();
10//! let doc = ezu_style::Document::from_json(&json).unwrap();
11//! println!("{} ({} nodes)", doc.name, doc.nodes.len());
12//! ```
13
14mod color;
15mod expand;
16mod jsonc;
17mod spec;
18
19pub use color::{parse_hex_color, parse_hex_color_u8};
20pub use expand::{expand_functions, ExpandError, Expanded, KindCheck, MAX_EXPANDED_NODES};
21pub use jsonc::{blank_comments, CommentError};
22pub use spec::*;
23
24#[derive(Debug, thiserror::Error)]
25pub enum StyleError {
26 #[error("style parse: {0}")]
27 Parse(#[from] serde_json::Error),
28 #[error("style parse: {0}")]
29 Comment(#[from] CommentError),
30}