Skip to content

Conversation

@gordonwoodhull
Copy link
Contributor

@gordonwoodhull gordonwoodhull commented Jan 13, 2026

To be merged after #13249

Should have feature parity with html and LaTeX on margin layout features and other Tufte layout features, using Typst's marginalia package.

Also includes:

PDF smoke-all test assertions:

  • ensurePdfTextPositions
  • ensurePdfMetadata

typst-gather

New command implemented in Rust for caching @preview Typst packages from the internet, and staging them from @local repos.

  • quarto call typst-gather for extensions; these go into _extensions/ext-name/typst/packages/
  • quarto dev-call typst-gather to gather dependencies of built-in Typst templates; these go to src/resources/formats/typst/packages

draft to test the rust build in ci - currently taking the simple approach and building typst-gather in configure.sh but we could build it in workflows instead.

gordonwoodhull and others added 5 commits January 12, 2026 16:33
- configure.sh/configure.cmd: Build typst-gather if Rust is available
- prepare-dist.ts: Stage typst-gather binary to distribution
- quarto-dev action: Install Rust 1.89 before configure for CI
- create-release.yml: Add Rust installation to release jobs
- Windows: Add typst-gather.exe to signing list

Note: Linux ARM64 distributions will not include typst-gather
(cross-compilation not yet supported).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Detect unconfigured @Local imports during gather and error (not warn)
- Add --init-config flag to `quarto call typst-gather` to generate
  starter typst-gather.toml with discovered imports
- Generated config includes [local] section with placeholder paths
  for any @Local imports found in scanned .typ files

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@posit-snyk-bot
Copy link
Collaborator

posit-snyk-bot commented Jan 13, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

gordonwoodhull and others added 11 commits January 13, 2026 10:17
- Downgrade from Rust edition 2024 to 2021 (2024 requires Rust 1.85+)
- Change rust-version from 1.89 to 1.81 (1.81 is available in stable Rust)
- Replace error() with console.error() for fatal errors
  (std/log error() is buffered and doesn't flush before Deno.exit())

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- --init-config now requires extension directory (no fallback to cwd)
- If no .typ files in _extension.yml, warn but still generate config
- When @Local imports are not configured, suggest running --init-config
- Print stdout/stderr from rust tool on failure for better debugging

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The typst-gather.toml now supports a rootdir field that specifies the
base directory for resolving discover and destination paths. This allows
the config file to live in the project root while paths remain relative
to the extension directory.

Generated config now looks like:
  rootdir = "_extensions/ext-name"
  destination = "typst/packages"
  discover = ["typst-template.typ", "typst-show.typ"]

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When typst-gather.toml exists, pass it directly to the rust tool instead
of creating a temp file. This ensures [local] and [preview] sections are
properly parsed.

Also only show --init-config tip when no config file was found.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tests added:
- Config file with rootdir resolves paths correctly
- --init-config generates config with rootdir
- @Local packages are copied when [local] section configured
- --init-config detects @Local imports

New fixtures:
- with-config/ - extension with typst-gather.toml using rootdir
- with-local/ - extension importing @local/my-local-pkg

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update both Quarto wrapper and Rust tool to show paths relative to the
current working directory instead of absolute paths for cleaner output.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When copying local packages, typst-gather now respects:
1. The `exclude` field from the package's typst.toml manifest
2. Default excludes for common non-package files (.git/, .github/,
   .gitignore, .vscode/, .idea/, editor backup files)

This prevents .git directories and other development files from being
copied into the destination package directory.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When a package is configured in [local], skip downloading the @Preview
version even if found in imports. This handles the case where a local
package contains template examples that import from @Preview (e.g.,
`template/main.typ` showing users how to use the published package).

Also adds tests for the local override behavior and copy filtering.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace threading of multiple parameters (storage, processed, stats,
discovered_local, configured_local) with a single GatherContext struct.
This simplifies function signatures and makes the code easier to follow.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Test `quarto use template` and render for typst templates from
quarto-ext/typst-templates repo. Supports switching between local
development path and GitHub for testing.

Templates tested: ams, dept-news, fiction, ieee, letter, poster

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Check for local/ and preview/ subdirectories before setting the
corresponding typst flags:
- --package-path only if local/ exists (for @Local packages)
- --package-cache-path only if preview/ exists (for @Preview packages)

This avoids passing unnecessary flags when only one type of package
is staged.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Base automatically changed from deps/pandoc-2025-08 to main January 14, 2026 10:59
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.

3 participants