Markdown → Typst (→ PDF) converter and CLI utility.
- Markdown → Typst translation with CommonMark + GFM support:
- Headings, emphasis, strong, strikethrough
- Lists: unordered, ordered, nested, and task lists
- Tables with per-column alignment
- Blockquotes, horizontal rules
- Footnotes
- Code blocks: passed through unchanged as fenced Markdown
- Smart CLI:
--output out.typ
→ emits Typst source--output out.pdf
→ compiles directly to PDF (auto-installs Typst if missing)
# Clone and build
git clone https://github.com/your-org/md2typ.git
cd md2typ
cargo build --release
# Install into your PATH
cargo install --path .
cargo install md2typ
Requires Rust 1.70+ and Cargo. If Typst is not already installed, the CLI will run
cargo install typst
on first PDF use.
# Translate Markdown to Typst (stdout)
md2typ README.md
# Save Typst output
md2typ README.md --output out.typ
# Produce PDF directly
md2typ README.md --output out.pdf
USAGE:
md2typst [OPTIONS] [INPUT]
ARGS:
<INPUT> Input Markdown file (default: stdin)
OPTIONS:
-o, --output <PATH> Output file: .typ (Typst source) or .pdf (compiled)
--preamble Add a simple Typst preamble at top
-h, --help Print help
-V, --version Print version
Convert a Markdown design doc to Typst:
md2typ docs/design.md --output docs/design.typ
Convert a report directly to PDF:
md2typ report.md --output report.pdf
Pipe Markdown from stdin:
cat notes.md | md2typ --output notes.pdf
Run unit tests:
cargo test
Format code:
cargo fmt
Lint:
cargo clippy --all-targets --all-features -- -D warnings
- Improve Typst table rendering
- Add more configurable preamble options
- Allow themes/templates for PDF output
- CI/CD builds & release binaries
Pull requests are welcome! Please open an issue to discuss changes or feature requests.
Apache 2.0 © 2025 Nervosys, LLC