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
59 changes: 0 additions & 59 deletions README.adoc

This file was deleted.

81 changes: 45 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,70 @@
[![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>
-->

// SPDX-License-Identifier: CC-BY-SA-4.0
= a2ml-haskell
Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
:toc:
:toc-placement: preamble
Haskell library for parsing and rendering A2ML (Attested Markup
Language) — attestation-native markup carrying trust metadata,
cryptographic attestation fields, and provenance information.

Haskell library for parsing and rendering A2ML (Attested Markup Language)
— attestation-native markup carrying trust metadata, cryptographic
attestation fields, and provenance information.
# Overview

== Overview
`a2ml-haskell` provides a purely functional parser and renderer over
`Text`:

`a2ml-haskell` provides a purely functional parser and renderer over `Text`:
- `Data.A2ML.Parser` — \`parseA2ML
Text → Either ParseError Document\`. Line-oriented, no regex, no
mutable state. Recognises headings, multi-line directive blocks
(`@name:` `…` `@end`), bullet lists, and inline formatting.

* `Data.A2ML.Parser` — `parseA2ML :: Text -> Either ParseError Document`.
Line-oriented, no regex, no mutable state. Recognises headings, multi-line
directive blocks (`@name: ... @end`), bullet lists, and inline formatting.
- `Data.A2ML.Renderer` — serialises a `Document` back to canonical A2ML.

* `Data.A2ML.Renderer` — serialises a `Document` back to canonical A2ML.
<!-- -->

* `Data.A2ML.Types` — `Document`, `Block`, `Inline`, `DirectiveName`
- `Data.A2ML.Types` — `Document`, `Block`, `Inline`, `DirectiveName`
(typed sum: `DirAbstract`, `DirRefs`, `DirAttestation`, `DirMeta`,
`DirCustom Text`), `Attestation`, `TrustLevel`, `Manifest`, `Reference`.
`DirCustom` `Text`), `Attestation`, `TrustLevel`, `Manifest`,
`Reference`.

The Haskell variant uses richer directive syntax than `a2ml-rs`: directives
are multi-line `@name: ... @end` blocks (not single-line `@name value` pairs).
The Haskell variant uses richer directive syntax than `a2ml-rs`:
directives are multi-line `@name:` `…` `@end` blocks (not single-line
`@name` `value` pairs).

== Attestation Model
# Attestation Model

The `Attestation` type carries:

* `attestationSigner` — identity of the signing agent or person
* `attestationAlgorithm` — e.g. `"ed25519"` or `"sha256"`
* `attestationSignature` — hex or base64 signature (opaque, not verified here)
* `attestationTimestamp` — optional ISO-8601 timestamp
- `attestationSigner` — identity of the signing agent or person

- `attestationAlgorithm` — e.g. `"ed25519"` or `"sha256"`

- `attestationSignature` — hex or base64 signature (opaque, not verified
here)

- `attestationTimestamp` — optional ISO-8601 timestamp

`TrustLevel` encodes attestor count and independence: `Unsigned` →
`SelfAttested` → `ThirdPartyAttested` → `MultiAttested`.

`Manifest` aggregates title, author, version, SPDX license, overall trust
level, and the full attestation list — the entry point for provenance
inspection.
`Manifest` aggregates title, author, version, SPDX license, overall
trust level, and the full attestation list — the entry point for
provenance inspection.

== Building
# Building

[source,sh]
----
```sh
cabal build
cabal test
----
```

# Related

== Related
- [a2ml-rs](https://github.com/hyperpolymath/a2ml-rs) — Rust
implementation

* link:https://github.com/hyperpolymath/a2ml-rs[a2ml-rs]Rust implementation
* link:https://github.com/hyperpolymath/pandoc-a2ml[pandoc-a2ml] — Pandoc Lua reader/writer
- [pandoc-a2ml](https://github.com/hyperpolymath/pandoc-a2ml)Pandoc
Lua reader/writer

== License
# License

MPL-2.0. See link:LICENSE[LICENSE].
MPL-2.0. See [LICENSE](LICENSE).
Loading