Markup parser and editor core
0

Configure Feed

Select the types of activity you want to include in your feed.

Zig 83.2%
Rust 8.9%
C 3.9%
Python 2.0%
Shell 0.6%
Nix 0.1%
Other 1.4%
201 1 22

Clone this repository

https://tangled.org/adammharris.tngl.sh/twig https://tangled.org/did:plc:yq5bkoa7utbme5onw7k6d4zt
git@tangled.org:adammharris.tngl.sh/twig git@tangled.org:did:plc:yq5bkoa7utbme5onw7k6d4zt

For self-hosted knots, clone URLs may differ based on your setup.


README.md

title: Twig author: adammharris created: 2026-07-08T22:39:41-07:00 updated: 2026-08-13T15:50:04-07:00 contents: ['DESIGN', 'AST-KINDS', 'COOKBOOK', 'CHANGELOG', 'AGENTS', 'RELEASING'] config: .config/prov.yaml#

Twig#

CI crates.io docs.rs license

A sister project to fig. While fig parses configuration files like JSON, YAML, and TOML, Twig parses document files, like HTML, Markdown, and Djot.

In this way, Twig is comparable to Pandoc, but Twig has different design goals:

  • In Twig, the goal isn't just to be a converter, but to expose the abstract syntax tree of a document, so that precise operations can be performed on it, similarly to how fig allows editing of config files.

  • Twig intends to primarily support "round-trippable" formats. This means no first-class support for for "presentation" formats, such as PDF. And no special handling for bibliographies/citations.

Status#

The following languages are implemented:

  • Djot — 100% conformant with the djot.js corpus: all 265 cases that define an HTML expectation pass. The 6 remaining cases assert against djot.js's internal AST-dump debug format (not HTML); their parser behaviours are covered directly by native AST unit tests instead.
  • Markdown (fully CommonMark 0.31.2 conformant — 652/652 spec examples passing)
  • HTML (generic-markup parser + serializer; forgiving document-oriented tree construction)

License#

Licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.