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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//! The [CompMD](https://compmd.dev/) processor: parses, validates and expands documents written in CompMD (Component
//! Markdown), as the [CompMD specification](https://github.com/comp-markdown/compmd/blob/main/spec/compmd-spec-v1.md)
//! describes, at the version [`SPEC_VERSION`] names.
//!
//! 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");
//! ```
/// The names packs and their files are known by: `PackName`, `ReleaseId`, `FilePath`, `Place`, `Integrity`.
pub use AllowedOrigins;
pub use compmd_pack as pack;
pub use ;
pub use Processor;
pub use ;
/// The version of the CompMD specification this processor implements (spec §1): a draft, `1.0-draft.N`, until the
/// spec's version 1 is released. The spec is versioned on its own, apart from this crate.
///
/// ```
/// assert!(compmd::SPEC_VERSION.starts_with("1.0"));
/// ```
pub const SPEC_VERSION: &str = "1.0-draft.18";