Deno-native parser library for A2ML (Attested Markup Language), written in ReScript.
A2ML is a structured markup language with built-in attestation provenance, directive metadata, and trust-level tracking. This library provides a complete parser and renderer for A2ML documents, compiled from ReScript to JavaScript ES modules for use with Deno.
-
Parse A2ML documents from strings or files
-
Render AST back to A2ML surface syntax (round-trip support)
-
Typed AST with variant types for blocks, inlines, directives, and attestations
-
Trust-level hierarchy: Unverified, Automated, Reviewed, Verified
-
Directive blocks with key-value attributes
-
Attestation provenance chain
-
Zero dependencies beyond ReScript standard library
# Build ReScript to JS
deno task build
# Use in your Deno project
deno add jsr:@hyperpolymath/a2mlimport { parse, render, parseErrorToString } from "@hyperpolymath/a2ml";
const result = parse("# Hello World\n\nSome **bold** text.\n");
// result is Ok(document) or Error(parseError)| Module | Purpose |
|---|---|
|
Main module — re-exports all public API |
|
Core data types: document, block, inline, directive, attestation, trustLevel |
|
Line-oriented parser: A2ML text to typed AST |
|
Renderer: typed AST back to A2ML text |
# Heading
Paragraph with **bold**, *italic*, `code`, [link](url), and @ref(id).
@directive-name(key=val): single line value
@multi-line:
Content spanning
multiple lines
@end
!attest
identity: Jonathan D.A. Jewell
role: author
trust-level: verified
timestamp: 2026-03-16T00:00:00Z
!end
- Bullet list item
- Another item
> Block quote text
```rescript
let x = 42
```deno task build # Compile ReScript
deno task clean # Clean build artifacts
deno task test # Run tests-
a2ml-rs — Rust implementation
-
a2ml-haskell — Haskell implementation
-
a2ml_gleam — Gleam implementation
-
tree-sitter-a2ml — Tree-sitter grammar
-
vscode-a2ml — VS Code extension
SPDX-License-Identifier: PMPL-1.0-or-later
Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath)
See LICENSE for details.