1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! The CompMD processor: parses, validates and expands documents written in CompMD (Component Markdown), as the
//! [CompMD specification](https://github.com/comp-markdown/compmd/blob/main/compmd-spec-v1.md) (version 1, draft)
//! describes.
//!
//! It implements stages 1 to 4b, everything up to rendering, as the states of a [`Processor`]: parsing gives a
//! document's [tree], resolving loads its imports and binds every component name, validating checks it against the
//! signatures, loading gives the inputs their values and loads the data, and expanding makes the [expanded
//! tree](expanded) a renderer draws, for one [render context](context); every stage adds its
//! [diagnostics](diagnostic). Expressions follow the CompMD CEL profile, with the `md.` functions (spec ยง8.2).
//!
//! The processor does no I/O: the caller hands it files, packs, remote and host data, and the time zones, through the
//! traits of [`host`], so it runs anywhere, a browser among them.
//!
//! ```
//! use compmd::{ParseOptions, Processor};
//!
//! let parsed = Processor::new("a.comp.md", ":: chart[Weekly installs] {src=installs.csv}\n")
//! .parse(&ParseOptions::default());
//! let json = serde_json::to_value(parsed.tree()).unwrap();
//! assert_eq!(json["children"][0]["type"], "componentLeaf");
//! ```
pub use ;
pub use Processor;
pub use ;