|
1 | | -[](https://github.com/sponsors/hyperpolymath) |
| 1 | +<!-- |
| 2 | +SPDX-License-Identifier: CC-BY-SA-4.0 |
| 3 | +SPDX-FileCopyrightText: 2025-2026 Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk> |
| 4 | +--> |
2 | 5 |
|
3 | | -// SPDX-License-Identifier: CC-BY-SA-4.0 |
4 | | -= a2ml-haskell |
5 | | -Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk> |
6 | | -:toc: |
7 | | -:toc-placement: preamble |
| 6 | +Haskell library for parsing and rendering A2ML (Attested Markup |
| 7 | +Language) — attestation-native markup carrying trust metadata, |
| 8 | +cryptographic attestation fields, and provenance information. |
8 | 9 |
|
9 | | -Haskell library for parsing and rendering A2ML (Attested Markup Language) |
10 | | -— attestation-native markup carrying trust metadata, cryptographic |
11 | | -attestation fields, and provenance information. |
| 10 | +# Overview |
12 | 11 |
|
13 | | -== Overview |
| 12 | +`a2ml-haskell` provides a purely functional parser and renderer over |
| 13 | +`Text`: |
14 | 14 |
|
15 | | -`a2ml-haskell` provides a purely functional parser and renderer over `Text`: |
| 15 | +- `Data.A2ML.Parser` — \`parseA2ML |
| 16 | + Text → Either ParseError Document\`. Line-oriented, no regex, no |
| 17 | + mutable state. Recognises headings, multi-line directive blocks |
| 18 | + (`@name:` `…` `@end`), bullet lists, and inline formatting. |
16 | 19 |
|
17 | | -* `Data.A2ML.Parser` — `parseA2ML :: Text -> Either ParseError Document`. |
18 | | - Line-oriented, no regex, no mutable state. Recognises headings, multi-line |
19 | | - directive blocks (`@name: ... @end`), bullet lists, and inline formatting. |
| 20 | +- `Data.A2ML.Renderer` — serialises a `Document` back to canonical A2ML. |
20 | 21 |
|
21 | | -* `Data.A2ML.Renderer` — serialises a `Document` back to canonical A2ML. |
| 22 | +<!-- --> |
22 | 23 |
|
23 | | -* `Data.A2ML.Types` — `Document`, `Block`, `Inline`, `DirectiveName` |
| 24 | +- `Data.A2ML.Types` — `Document`, `Block`, `Inline`, `DirectiveName` |
24 | 25 | (typed sum: `DirAbstract`, `DirRefs`, `DirAttestation`, `DirMeta`, |
25 | | - `DirCustom Text`), `Attestation`, `TrustLevel`, `Manifest`, `Reference`. |
| 26 | + `DirCustom` `Text`), `Attestation`, `TrustLevel`, `Manifest`, |
| 27 | + `Reference`. |
26 | 28 |
|
27 | | -The Haskell variant uses richer directive syntax than `a2ml-rs`: directives |
28 | | -are multi-line `@name: ... @end` blocks (not single-line `@name value` pairs). |
| 29 | +The Haskell variant uses richer directive syntax than `a2ml-rs`: |
| 30 | +directives are multi-line `@name:` `…` `@end` blocks (not single-line |
| 31 | +`@name` `value` pairs). |
29 | 32 |
|
30 | | -== Attestation Model |
| 33 | +# Attestation Model |
31 | 34 |
|
32 | 35 | The `Attestation` type carries: |
33 | 36 |
|
34 | | -* `attestationSigner` — identity of the signing agent or person |
35 | | -* `attestationAlgorithm` — e.g. `"ed25519"` or `"sha256"` |
36 | | -* `attestationSignature` — hex or base64 signature (opaque, not verified here) |
37 | | -* `attestationTimestamp` — optional ISO-8601 timestamp |
| 37 | +- `attestationSigner` — identity of the signing agent or person |
| 38 | + |
| 39 | +- `attestationAlgorithm` — e.g. `"ed25519"` or `"sha256"` |
| 40 | + |
| 41 | +- `attestationSignature` — hex or base64 signature (opaque, not verified |
| 42 | + here) |
| 43 | + |
| 44 | +- `attestationTimestamp` — optional ISO-8601 timestamp |
38 | 45 |
|
39 | 46 | `TrustLevel` encodes attestor count and independence: `Unsigned` → |
40 | 47 | `SelfAttested` → `ThirdPartyAttested` → `MultiAttested`. |
41 | 48 |
|
42 | | -`Manifest` aggregates title, author, version, SPDX license, overall trust |
43 | | -level, and the full attestation list — the entry point for provenance |
44 | | -inspection. |
| 49 | +`Manifest` aggregates title, author, version, SPDX license, overall |
| 50 | +trust level, and the full attestation list — the entry point for |
| 51 | +provenance inspection. |
45 | 52 |
|
46 | | -== Building |
| 53 | +# Building |
47 | 54 |
|
48 | | -[source,sh] |
49 | | ----- |
| 55 | +```sh |
50 | 56 | cabal build |
51 | 57 | cabal test |
52 | | ----- |
| 58 | +``` |
| 59 | + |
| 60 | +# Related |
53 | 61 |
|
54 | | -== Related |
| 62 | +- [a2ml-rs](https://github.com/hyperpolymath/a2ml-rs) — Rust |
| 63 | + implementation |
55 | 64 |
|
56 | | -* link:https://github.com/hyperpolymath/a2ml-rs[a2ml-rs] — Rust implementation |
57 | | -* link:https://github.com/hyperpolymath/pandoc-a2ml[pandoc-a2ml] — Pandoc Lua reader/writer |
| 65 | +- [pandoc-a2ml](https://github.com/hyperpolymath/pandoc-a2ml) — Pandoc |
| 66 | + Lua reader/writer |
58 | 67 |
|
59 | | -== License |
| 68 | +# License |
60 | 69 |
|
61 | | -MPL-2.0. See link:LICENSE[LICENSE]. |
| 70 | +MPL-2.0. See [LICENSE](LICENSE). |
0 commit comments