Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 0 additions & 117 deletions README.adoc

This file was deleted.

152 changes: 76 additions & 76 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,119 +1,119 @@
[![Sponsor](https://img.shields.io/badge/Sponsor-%E2%9D%A4-pink?logo=github)](https://github.com/sponsors/hyperpolymath)
<!--
SPDX-License-Identifier: CC-BY-SA-4.0
SPDX-FileCopyrightText: 2025-2026 Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
-->

# Overview

**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.

= a2ml-deno
:toc: preamble
:icons: font
# Features

== Overview
- Parse A2ML documents from strings or files

**Deno-native parser library for A2ML (Attested Markup Language), written in ReScript.**
- Render AST back to A2ML surface syntax (round-trip support)

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.
- Typed AST with variant types for blocks, inlines, directives, and
attestations

== Features
- Trust-level hierarchy: Unverified, Automated, Reviewed, Verified

* 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
- Directive blocks with key-value attributes

== Quick Start
- Attestation provenance chain

[source,bash]
----
- Zero dependencies beyond ReScript standard library

# Quick Start

```bash
# Build ReScript to JS
deno task build

# Use in your Deno project
deno add jsr:@hyperpolymath/a2ml
----
```

[source,javascript]
----
```javascript
import { parse, render, parseErrorToString } from "@hyperpolymath/a2ml";

const result = parse("# Hello World\n\nSome **bold** text.\n");
// result is Ok(document) or Error(parseError)
----
```

== Module Structure
# Module Structure

[cols="1,3"]
|===
| Module | Purpose
| Module | Purpose |
|----|----|
| `A2ML.res` | Main module — re-exports all public API |
| `A2ML_Types.res` | Core data types: document, block, inline, directive, attestation, trustLevel |
| `A2ML_Parser.res` | Line-oriented parser: A2ML text to typed AST |
| `A2ML_Renderer.res` | Renderer: typed AST back to A2ML text |

| `A2ML.res`
| Main module — re-exports all public API
# A2ML Syntax Reference

| `A2ML_Types.res`
| Core data types: document, block, inline, directive, attestation, trustLevel
# Heading

| `A2ML_Parser.res`
| Line-oriented parser: A2ML text to typed AST
Paragraph with **bold**, *italic*, `code`, [link](url), and @ref(id).

| `A2ML_Renderer.res`
| Renderer: typed AST back to A2ML text
|===
@directive-name(key=val): single line value

== A2ML Syntax Reference
@multi-line:
Content spanning
multiple lines
@end

[source]
----
# Heading
!attest
identity: Jonathan D.A. Jewell
role: author
trust-level: verified
timestamp: 2026-03-16T00:00:00Z
!end

Paragraph with **bold**, *italic*, `code`, [link](url), and @ref(id).
- Bullet list item
- Another item

@directive-name(key=val): single line value
> Block quote text

@multi-line:
Content spanning
multiple lines
@end
```rescript
let x = 42
```

!attest
identity: Jonathan D.A. Jewell
role: author
trust-level: verified
timestamp: 2026-03-16T00:00:00Z
!end
# Development

- Bullet list item
- Another item
```bash
deno task build # Compile ReScript
deno task clean # Clean build artifacts
deno task test # Run tests
```

> Block quote text
# Related Libraries

```rescript
let x = 42
```
----
- [a2ml-rs](https://github.com/hyperpolymath/a2ml-rs) — Rust
implementation

== Development
- [a2ml-haskell](https://github.com/hyperpolymath/a2ml-haskell) —
Haskell implementation

[source,bash]
----
deno task build # Compile ReScript
deno task clean # Clean build artifacts
deno task test # Run tests
----
- [a2ml_gleam](https://github.com/hyperpolymath/a2ml_gleam) — Gleam
implementation

== Related Libraries
- [tree-sitter-a2ml](https://github.com/hyperpolymath/tree-sitter-a2ml)
— Tree-sitter grammar

* link:https://github.com/hyperpolymath/a2ml-rs[a2ml-rs] — Rust implementation
* link:https://github.com/hyperpolymath/a2ml-haskell[a2ml-haskell] — Haskell implementation
* link:https://github.com/hyperpolymath/a2ml_gleam[a2ml_gleam] — Gleam implementation
* link:https://github.com/hyperpolymath/tree-sitter-a2ml[tree-sitter-a2ml] — Tree-sitter grammar
* link:https://github.com/hyperpolymath/vscode-a2ml[vscode-a2ml] — VS Code extension
- [vscode-a2ml](https://github.com/hyperpolymath/vscode-a2ml) — VS Code
extension

== License
# License

SPDX-License-Identifier: CC-BY-SA-4.0

Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath)

See link:LICENSE[LICENSE] for details.
See [LICENSE](LICENSE) for details.
Loading