Skip to content

build(deps)!: move to fig 7 and twig 6 - #12

Merged
adammharris merged 1 commit into
mainfrom
cc/modest-mendel-tw57ql
Oct 15, 2026
Merged

adammharris merged 1 commit into
mainfrom
cc/modest-mendel-tw57ql

Conversation

@adammharris

@adammharris adammharris commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Moves prov from fig 5 / twig-doc 4 to fig 7 / twig-doc 6. fig 6 moved embedding out of fig and into twig, so this is a redesign of how prov reads and writes a document's metadata block, not just a version bump.

Design decisions

  • Only frontmatter is read. Supported: --- YAML, +++ TOML and ---<lang> (---json, ---toml, ---figl, and ---fig still reads). twig locates the block (twig::meta), and MetaEditor edits through twig::meta::Embed.
    • ;;; JSON blocks, fenced code blocks (including ```endmatter), and HTML <script>/<pre><code> islands are no longer read. A document using one of them reads as having no metadata.
    • EmbedStyle is now just Delimited | Separate.
  • prov_graph::MetaFormat { Yaml, Json, Toml, Figl } replaces fig::Format across the API. fig 7's Format is a handle looked up by name, not an enum. MetaFormat::fig() converts to that handle, registering the language on first use.
  • The per-format features are gone (yaml, json, toml, fig-lang). twig's fig feature always builds all four languages, and with no Zig left there was nothing for the features to trim. xtask's package-isolation list changes to match.
  • figl is written as figl: in metadata.format, in new fences, and in CLI flags. fig is still accepted when reading.
  • Converting a block's format is done in prov. reformat_block/retype_block write the fences themselves (---, +++, ---json, ---figl), because twig has no retype yet. An empty JSON body doesn't parse, so a new ---json block starts with {}.
  • init --content djot|html now defaults to --embed separate. The old defaults (a fenced code block and a script island) are gone, and a leading --- reads as a thematic break in Djot and as visible text in a browser.
  • No more Zig: removed from ci.yml, homebrew.yml, flake.nix, the README and getting-started.

Blockers before merge

  • fig-schema is a git dependency for now. prov points at the branch of build(deps)!: move to fig 7 fig-schema#1. Once fig-schema 0.5.0 is released, switch the workspace manifest to version = "0.5". The flake sets allowBuiltinFetchGit for that git dependency; drop it at the same time.

Behavioural changes

These are listed as Behavioural-change: trailers on the commit. In short:

  • documents using the dropped archetypes stop being read;
  • new JSON frontmatter is written ---json, and new figl frontmatter ---figl;
  • code_block, html_script and html_code are no longer accepted as metadata.embed values;
  • Djot and HTML workspaces from init now default to separate;
  • figl is spelled figl;
  • two fig 7 layout differences: a removed list key leaves the item's next key at its head, and a mapping spliced into a figl list is written in flow form. The values are unchanged.

Checks

All pass locally:

  • cargo fmt --check
  • cargo clippy --workspace --all-targets -D warnings
  • cargo test --workspace (all 46 targets)
  • cargo xtask package-isolation
  • the getting-started transcript replay
  • an MSRV build on 1.88

fig 6 made every format a language a program registers and took
embedding out of fig; fig 7 and twig 6 are both pure Rust, and twig 6
took embedding in, as `twig::meta`, behind its default `fig` feature.

- `prov_graph::MetaFormat` (Yaml, Json, Toml, Figl) is prov's closed
  name for the four metadata languages, in place of `fig::Format`,
  which is a per-process handle now. It turns into fig's handle,
  registering the language crate, only where fig parses or prints.
- A document's frontmatter is located by twig, and `MetaCarrier::Fenced`
  carries its `MetaFormat` where it carried fig's `EmbedType`.
  `MetaEditor` edits through `twig::meta::Embed`; `reformat_block` and
  `retype_block` (convert's re-fence) write the block themselves, since
  twig has no retype yet.
- `EmbedStyle` is `Delimited` or `Separate`. `CodeBlock`, `HtmlScript`
  and `HtmlCode` are gone with the archetypes twig does not read.
- The per-format features (`yaml`, `json`, `toml`, `fig-lang`) are gone:
  twig's `fig` feature compiles all four in, and with no Zig left there
  was nothing for them to trim. CI, the release workflow and the flake
  stop installing Zig.
- fig-schema comes from git until its fig 7 release is on crates.io.

Behavioural-change: Only frontmatter is read as metadata: `---` YAML,
  `+++` TOML and `---<lang>` (`---json`, `---toml`, `---figl`, `---fig`).
  A document whose metadata is a `;;;` JSON block, a fenced code block
  (```` ```yaml ````, ```` ```fig ````, ```` ```endmatter ````), or an
  HTML `<script>` or `<pre><code>` island reads as having no metadata,
  its whole text the body. Convert such a document before upgrading.
Behavioural-change: New JSON frontmatter is written `---json` … `---`,
  where it was `;;;` … `;;;`, and new figl frontmatter `---figl` … `---`,
  where it was a ```` ```fig ```` block. `metadata.format: json` with
  `embed: delimited` therefore writes `---json`, and `metadata.format:
  figl` with `embed: delimited`, refused before, is accepted.
Behavioural-change: `metadata.embed: code_block`, `html_script` and
  `html_code` are no longer values: a config naming one reads as the
  default (`delimited`), with the config finding an unknown value gets,
  and `prov init --embed` no longer offers them.
Behavioural-change: `prov init --content djot` and `--content html`
  default to `--embed separate`. They defaulted to a fenced code block
  and an HTML `<script>` island, which are gone; a leading `---` would
  read as a thematic break to a Djot renderer and as text to a browser.
Behavioural-change: figl is spelled `figl`: `metadata.format` is
  written `figl` (`fig` still reads), `prov init --meta` and `prov meta
  --format` take `figl` (and `fig` as an alias), and `prov about`
  calls the language figl.
Behavioural-change: Removing a key from a YAML list item leaves the
  item's next key at the item's head (`- title: Gone`) where fig 5 kept
  its indent, and a mapping spliced into a figl list is written in flow
  form (`[{content=/a.svg …}]`). The values are unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant