Skip to content

fix(converter): recognize .typ as Typst input and output - #32

Merged
mtmatt merged 1 commit into
mainfrom
fix/typ-extension
Oct 6, 2026
Merged

mtmatt merged 1 commit into
mainfrom
fix/typ-extension

Conversation

@mtmatt

@mtmatt mtmatt commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Typst files use the .typ extension, but the converter only recognized .typst. Dropping a real Typst file failed with "No conversion path from .typ to pdf".

Changes

  • normalize_ext maps typ → typst, so detection and multi-hop routing accept .typ.
  • The typst→pdf fast path (typst compile) normalizes the input extension first, so .typ takes it.
  • Pandoc reads .typ with its typst reader.
  • Typst output is written as .typ (not .typst), so the result opens in Typst tooling and converts back.

Testing

  • New unit tests cover .typ detection, find_path("typ", "pdf"), the pandoc reader mapping, and the output extension. 128 unit tests plus the CLI end-to-end tests pass. clippy -D warnings and fmt are clean.
  • Ran the dev CLI on macOS (pandoc 3.9, typst):
    • .typ → pdf works, and CJK text renders.
    • md → typst writes .typ, and that file converts back to pdf.
    • .typ → md works.
  • Also confirmed that md→pdf (including CJK) works on current main after fix(pdf): auto-install typst on Linux/Windows, render CJK text in PDFs #30.

🤖 Generated with Claude Code

Typst files use the .typ extension, but only .typst was recognized, so
.typ -> pdf failed with "No conversion path". Normalize .typ to the typst
node, read it with pandoc's typst reader, and write Typst output as .typ.
@mtmatt
mtmatt merged commit 7510dc6 into main Oct 6, 2026
9 checks passed
@mtmatt
mtmatt deleted the fix/typ-extension branch October 6, 2026 12:14
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