zenith_core/validate/mod.rs
1//! Document-level semantic validation pass for Zenith.
2//!
3//! This module wires together the validation submodule and re-exports the
4//! public API surface. All logic lives in `check`.
5//!
6//! # Public API
7//!
8//! ```rust
9//! use zenith_core::{validate, KdlAdapter, KdlSource};
10//!
11//! let src = r##"zenith version=1 {
12//! project id="p" name="P"
13//! tokens format="zenith-token-v1" { }
14//! styles { }
15//! document id="d" title="D" {
16//! page id="pg" w=(px)100 h=(px)100 { }
17//! }
18//! }"##;
19//!
20//! let doc = KdlAdapter.parse(src.as_bytes()).expect("parses");
21//! let report = validate(&doc);
22//! assert!(!report.has_errors());
23//! ```
24
25mod check;
26
27pub use check::{ValidationReport, apply_policy, validate, validate_with_policy};