This repository was archived by the owner on Nov 12, 2026. It is now read-only.
Repository navigation
build(deps)!: move to twig 6 - #11
Merged
Merged
Conversation
twig 6 is pure Rust, and its core names no language: `twig::Format` is an opaque handle a language crate (twig-markdown, twig-djot, twig-html, twig-asciidoc, twig-xml) hands back when it registers itself, and the Markdown extensions are named features laid over a row as a flag mask. - `leaf_core::Format` is leaf's own enum, with the five variants leaf opens under the names they always had (`Markdown`, `Djot`, `Html`, `Asciidoc`, `Xml`), still `#[non_exhaustive]`. It was a re-export of twig 4's enum; `Format::twig()` (and `From<Format> for twig::Format`) is the handle twig is called with, and `supports`, `supports_with` (now a feature mask), `is_authorable` and `name` delegate to it. - `parse_extensions` is the feature mask for a format: Markdown's five features, nothing for the languages that declare none. - `leaf_math_edit::doc::editor` takes twig's handle as before and asks for the `math` feature where the format has one. - twig-doc is taken without its default `fig` feature: `twig::meta` (frontmatter through fig, and a document's `twig:` key obeyed) is nothing leaf asks for, and off it brings no YAML/TOML/JSON/figl parser. So a document is still parsed exactly as leaf asks. - With no Zig left, CI, the release workflow and the Xcode Cloud post-clone hook stop installing it, the flake drops the zig/cctools build steps for diaryx-nix's `rust` shell (and lets cargoLock fetch the lockfile's git entries by rev, which it already needed for fig-css), and comments about twig-sys are updated. Android keeps minSdk 29, which only the Zig library required. - The gpui, Dioxus and spike workspaces' lockfiles move to twig 6 too (the gpui ones had not yet picked up fig-css either). Behavioural-change: `leaf_core::Format` is no longer `twig::Format`. Code that names its variants is unchanged; code that hands it to twig calls `.twig()` (or `.into()`), and `Format::supports_with` takes a feature mask where it took `twig::MarkdownExtensions`. twig 4's other rows and methods (`Commonmark`, `Gfm`, extension lookup) are not on it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves leaf from twig-doc 4.1 to twig 6, which is pure Rust. provui builds leaf together with prov, and prov is already on twig 6 (diaryx-org/prov#12).
Changes
twig-doc = { version = "6", default-features = false }, plus the five language crates leaf opens: twig-markdown, twig-djot, twig-html, twig-asciidoc and twig-xml.figfeature is off. leaf never usedtwig::meta, and turning it off keeps the YAML, TOML, JSON and figl parsers out of leaf. As in twig 4, a document'stwig:frontmatter key is ignored.leaf_core::Formatis now leaf's own enum (crates/leaf-core/src/format.rs). It keeps the same variants and is still#[non_exhaustive]..twig()/Fromgives twig's handle.supports,supports_with,is_authorableandnamepass through to twig, and it gainsDisplay.Editor::new_with_flags.leaf_math_edit::doc::editorkeeps its signature, and itswasmfeature pulls in twig-markdown.setup-zig), the Homebrew workflow, the flake (now therustdev shell), the Xcode Cloud post-clone script, and comments in.cargo/config.toml, the Android files,xtask/src/android.rs, the leaf-ffi safety comment and the Swift README.allowBuiltinFetchGit = true. It was already needed for the fig-css and mermaid git dependencies.apps/leaf-ios, which is archived, is untouched.Behavioural change
leaf_core::Formatis no longertwig::Format. Code that only names its variants is unchanged. Code that hands it to twig calls.twig().supports_withtakes a feature mask, and twig 4's other formats and methods (Commonmark,Gfm, extension lookup) are not on leaf's enum. All 874 leaf-core tests pass unchanged on twig 6.Checks
Run locally after rebasing onto
a8b196c:-D warnings)leaf-tuicargo checkof the separate workspacesleaf-tui'sthe_bar_hands_the_host_s_own_chords_back_to_the_hostfails, because it needs a system clipboard. It fails the same way on unmodifiedmain.Left as is
minSdkstays at 29. Only the Zig library required that, so it could probably go lower, but a lower value should be tried on a device first.Generated by Claude Code