#![forbid(unsafe_code)]
pub mod allowance;
pub mod attributes;
pub mod check;
pub mod digest;
pub mod inline;
pub mod jcs;
mod js;
pub mod legacy;
pub mod lines;
pub mod objects;
pub mod pattern;
pub mod protocol;
pub mod read;
pub mod registry;
pub mod resolve;
pub mod text;
pub mod types;
#[cfg(feature = "verify")]
pub mod verify;
pub mod workflow;
pub mod yaml;
pub use attributes::parse_attributes;
pub use check::{Target, check, check_reading, inline_diagnostics, resolve_target, workflows_diagnostics};
pub use digest::{author_digest, digest, digest_text, front_matter_id, sha256_hex};
pub use inline::{InlineToken, TokenType, inline_tokens, split_wiki};
pub use jcs::{canonical_json, json_digest};
pub use js::js_number;
pub use legacy::{LEGACY_SYNTAX, legacy_diagnostics};
pub use lines::{LineInfo, classify_lines, format};
pub use objects::{
ConfigurationBlock, ConnectedObject, Location, carries_configuration, configuration_blocks, connected_objects, is_connected, is_layout,
walk,
};
pub use pattern::Pattern;
pub use read::{ReadOptions, Reading, SplitBackmatter, Stripped, read, split_backmatter, strip_comments, value_fits, value_from};
pub use registry::{AttrSpec, KindSpec, Registry, all_families, attr_spec, canonical_kind, inline_attr_spec, is_rule, registry};
pub use resolve::{
Dependency, ExtensionBinding, Loader, Manifest, Provenance, RESOLVED_FORMAT, Resolution, ResolveOptions, Resolved, ResolvedDocument,
Selector, Source, references_of, resolve, resolve_tree, resolve_uri, resolve_with, slug,
};
pub use text::{Known, ReferenceRecord, TextOptions, to_text, value_text};
pub use types::{
Attrs, Diagnostic, Document, Form, Identity, Metadata, Node, NodeType, Object, Parameter, Range, Severity, StructuredValue, TREE_FORMAT,
};
#[cfg(feature = "verify")]
pub use verify::{
DeliveryVerifyOptions, Jwk, SigningKey, VERIFY_CODES, VerifyOptions, VerifyResult, public_jwk, sign_jws, verify_author, verify_delivery,
};
pub use workflow::{
WORKFLOW_DIALECT, WORKFLOW_SCOPES, WorkflowKind, WorkflowLimits, WorkflowRegistry, workflow_diagnostics, workflow_registry,
workflow_scope,
};
pub use yaml::parse_yaml;
pub const SPEC_COMMIT: &str = "bf4f9a0";
pub fn deliver(text: &str, params: Option<&Object>) -> (String, Vec<Diagnostic>) {
let r = read(text, &ReadOptions::default());
let mut diagnostics = check_reading(&r);
let legacy = legacy_diagnostics(text);
if !legacy.is_empty() {
diagnostics.extend(legacy);
diagnostics.sort_by_key(|d| d.line().unwrap_or(0));
}
(r.text(params), diagnostics)
}