Skip to content

Fix local extension override for typst book format#14332

Open
gordonwoodhull wants to merge 1 commit intomainfrom
bugfix/14326
Open

Fix local extension override for typst book format#14332
gordonwoodhull wants to merge 1 commit intomainfrom
bugfix/14326

Conversation

@gordonwoodhull
Copy link
Copy Markdown
Contributor

Summary

  • When a user explicitly specifies format: orange-book-typst in a book project and has a locally installed copy of the extension, the local copy is now used instead of the built-in one
  • format: typst in book projects continues to use the built-in orange-book as the default
  • Adds a preferLocal flag threaded through the extension lookup chain (ExtensionContext.extension()loadExtension()discoverExtensionPath()), defaulting to false so all other extension resolution is unchanged

Test plan

  • New test tests/docs/smoke-all/typst/override-orange-book/ verifies local extension's typst-show.typ is used when format: orange-book-typst is explicit
  • Verified test fails without the fix, passes with it
  • Existing tests/docs/smoke-all/typst/orange-book/ tests pass (no regression for format: typst default)
  • Typechecks clean

Fixes #14326

When a user explicitly specifies `format: orange-book-typst` in a book
project, prefer a locally installed copy of the extension over the
built-in one, so customizations take effect. The default behavior for
`format: typst` (which auto-assigns orange-book) is unchanged.

Adds a `preferLocal` flag threaded through the extension lookup chain
that, when set, checks local `_extensions/` before built-in extensions.
Only the explicit typst book extension case sets this flag.

Fixes #14326
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.

Local extensions are ignored

1 participant