Skip to content

feat(docs): add an offline Typst house-style package - #2015

Merged
gerchowl merged 18 commits into
devfrom
feature/1994-typst-house-style
Nov 3, 2026
Merged

gerchowl merged 18 commits into
devfrom
feature/1994-typst-house-style

Conversation

@gerchowl

@gerchowl gerchowl commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Description

Documents opting into the docs module can import @local/devkit-docs:0.1.1 offline and apply #show: devkit-document.with(...). The neutral house style supplies document layout, booktabs tables, captions, and reusable components. Branding comes through parameters. The original 0.1.0 import remains available.

Type of Change

  • feat -- New feature
  • fix -- Table layout, caption validation and consumer package discovery
  • docs -- Public API, limitations and version policy
  • test -- Real-tool regressions and mutation checks
  • build -- Offline registry and isolated document tools

Modifiers

  • Breaking change (!)

Changes Made

  • Supply A4 layout, built-in fonts, a type scale, optional title metadata, running titles, page totals/revision stamps, captions, callouts, revision history and document references. Preserve built-in names and require the show-rule namespace form.
  • Preserve spanned cells and explicit header positions/repeat/level settings. Paginate long table figures with repeated headers. Plain-table opt-outs use cell metadata, so user labels and references remain usable. Nested plain tables do not opt out an enclosing ordinary table; native defaults and header positions/settings are covered.
  • Honor resolved table stroke/inset overrides, including set and show-set rules. Export booktabs-table for an explicit custom inset, including the native 5 pt default. Document the limits of distinguishing explicit native defaults from omitted fields.
  • Reject absent, empty, whitespace-only and hidden/zero-width captions. Accept reference-only, citation, styled, contextual, smartquote, show-rule, image and math captions; walk child/body/children and accept opaque elements.
  • Wrap docs Typst and Tinymist to compose consumer package paths, the devkit registry and standard data-dir packages. Hooks and recipes share the wrappers. Preserve font isolation and stable dependency inputs after temporary registry cleanup. Accept both spaced and equals forms of deps options and rewrite JSON, Make and zero output in files or on stdout. Forward SIGHUP/SIGTERM/SIGINT and remove the union after child exit. Rewrite produced dependencies for every child exit status, including failed compilation and signal termination, and update symlink targets without replacing their links.
  • Lock package contents by version, retain the initial 0.1.0 source alongside 0.1.1, verify both imports offline, hash all vendored preview packages, and check retained versions against an independent release ledger. Document that the guard validates a single-commit snapshot and does not enforce append-only Git history. Exclude only the injected local root LICENSE from content hashes. Vendor licensed fletcher/CeTZ dependencies unchanged.
  • Check real PDF text/positions/fonts and SVG rule thicknesses. Kill twenty-one mutants, including all seven identified in round three and S1/S2/S4/S8/S9, and count any regression exception as a failure.

Changelog Entry

Added

  • Offline Typst house-style package (#1994)
    • Add the versioned, neutral devkit-docs package with document layout, booktabs tables, captions, callouts, revisions, and document references.
    • Share its immutable package registry across docs shells and hooks; vendor licensed diagram dependencies and verify real offline builds.
    • Preserve spanned table layouts and explicit header settings, provide native-table opt-out, paginate table figures, and reject blank captions.
    • Preserve labelled plain-table opt-outs and table overrides, accept visible non-text captions, lock package contents, retain old versions, and share consumer/data-dir registries with stable dependency paths.
    • Preserve dependency paths after failed or terminated compiles, forward SIGHUP, and follow symlinked dependency outputs without replacing the link.
    • Stabilize every dependency output format and flag spelling, forward compiler signals, verify vendored hashes and retained releases, and scope nested table opt-outs.
    • Give the package independent SemVer, preserve built-in names, add short titles, and share font isolation and consumer registries across document tools.

Testing

  • Targeted tests pass locally (186 passed, exit 0).
  • Manual real-tool verification performed.

Manual Testing Details

  • RED before implementation: sandbox fixtures reproduced the labelled plain-table failure, ignored overrides, rejected visible captions, accepted invisible captions, missing lock and missing consumer packages (Nix exit 1). Failing tests committed before implementation.
  • RED: dependency cleanup pytest reproduced deleted temporary paths in deps.json (exit 1).
  • uv run --with pytest-xdist pytest packages/vig-utils/tests/test_typst_guard.py packages/vig-utils/tests/test_typst_packages.py tests/test_typst_docs.py tests/test_typst_reconcile.py -n 4 --basetemp=$HOME/.cache/devkit-pytest/1994-r5-green — 186 passed, exit 0.
  • nix build .#checks.x86_64-linux.typst-house-style .#checks.x86_64-linux.typst-canary .#checks.x86_64-linux.module-docs .#checks.x86_64-linux.formatting .#checks.x86_64-linux.pre-commit --max-jobs 1 --no-link -L — exit 0.
  • RED: dependency/signal/integrity regressions and nested-table opt-out leakage failed before their fixes. The nonzero-exit follow-up produced 37 failing pytest cases (exit 1) and four failing real compile cases (JSON/zero, file/stdout; Nix exit 1). Tests were committed before implementation.
  • Real subprocess tests preserve exit 143 after emitting dependencies; the watch fixture uses default SIGHUP/SIGTERM/SIGINT termination and checks 129/143/130, child disappearance, stable dependencies and union cleanup. Symlink tests cover all three formats with exits 0 and 143. Failed real Typst compiles cover JSON/zero in files and on stdout. Missing artifacts add no diagnostics, and rewrite I/O errors preserve both successful and failing child statuses.
  • Tests cover both spellings of both options, all three formats in files/stdout, special-character path escaping, signal forwarding/cleanup, atomic I/O failure handling, vendor mutation, nested LICENSE changes, and removal of 0.1.0 together with its lock entry.
  • House-style checks cover both consumer package locations through direct Typst, Tinymist, generated hooks and recipes; stable dependencies; retained imports and content hashes; all caption cases; table overrides/positions/rules; twenty-one killed mutants; offline builds and byte-identical canonical output.
  • Container and nix-eval pytest suites remain CI-owned.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review
  • Difficult implementation details are commented
  • Public documentation is updated
  • CHANGELOG.md and its scaffold copies are updated under Unreleased
  • Changes generate no new warnings or errors
  • Tests prove the feature and fixes
  • Targeted tests pass locally
  • Dependency closure is vendored with licenses

Additional Notes

Make output is preserved verbatim when a resolved package root contains CR, LF or backslash; JSON and zero are preferred for those roots. Artifact I/O failures preserve the child exit status and the native artifact, with a stderr diagnostic. Dependency stdout is buffered until child exit; ordinary stdout streams normally. The release ledger checks only a single-commit snapshot; editing it can bypass removal detection, including across commits. The append-only policy requires review. Consumer paths take precedence over devkit, then data-dir packages; same-named package precedence is tested through all tool paths.

Plot/glossary rendering, slides and content guards remain separate later phases under #1994. Figure lettering has a 7 pt minimum in the type scale; arbitrary lettering enforcement belongs to those content guards. Numeric helpers do not parse, round or align decimal separators. No merge or workflow dispatch is part of this PR.

Refs: #1994

@gerchowl
gerchowl force-pushed the feature/1994-typst-house-style branch from f3e326b to 9a3b74e Compare November 3, 2026 19:27
@gerchowl gerchowl changed the title feat(docs): add the offline Typst house-style core feat(docs): add an offline Typst house-style package Nov 3, 2026
Retain package versions with content hashes, accept visible captions, and preserve labelled native tables and resolved settings.

Refs: #1994
Verify vendored content and retained releases, and scope plain-table markers to their own table.

Refs: #1994
Forward SIGHUP, preserve dependency symlinks, and document the release ledger snapshot limit.

Refs: #1994
@gerchowl
gerchowl merged commit 06f9cde into dev Nov 3, 2026
19 of 20 checks passed
@gerchowl
gerchowl deleted the feature/1994-typst-house-style branch November 3, 2026 21:40
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