Skip to main content

a2ml/
lib.rs

1// SPDX-License-Identifier: MPL-2.0
2// (PMPL-1.0-or-later preferred; MPL-2.0 required for crates.io)
3
4//! # a2ml
5//!
6//! Parser and renderer for **A2ML** (Attested Markup Language).
7//!
8//! A2ML is a lightweight markup format designed for AI-agent communication
9//! that carries built-in attestation metadata, enabling provenance tracking
10//! and trust-level annotations on document content.
11//!
12//! ## Quick start
13//!
14//! ```
15//! use a2ml::parser::parse;
16//! use a2ml::renderer::render;
17//!
18//! let input = "# Hello\n\n@version 1.0\n\nA paragraph.";
19//! let doc = parse(input).unwrap();
20//! let output = render(&doc).unwrap();
21//! ```
22//!
23//! ## Modules
24//!
25//! - [`types`] — Core data structures (`Document`, `Block`, `Inline`, etc.)
26//! - [`parser`] — Parse A2ML text into a `Document`
27//! - [`renderer`] — Render a `Document` back to A2ML text
28//! - [`error`] — Error types
29
30pub mod error;
31pub mod parser;
32pub mod renderer;
33pub mod types;
34
35// Re-export the most commonly used items at the crate root for convenience.
36pub use error::A2mlError;
37pub use types::{Attestation, Block, Directive, Document, Inline, Manifest, TrustLevel};