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)--template file.typ→ applies custom Typst template for advanced styling
- Template support: Use custom Typst templates for professional formatting
# 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 md2typRequires Rust 1.70+ and Cargo. If Typst is not already installed, the CLI will run
cargo install typston 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.pdfUSAGE:
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
-t, --template <PATH> Use a Typst template file (overrides --preamble)
-h, --help Print help
-V, --version Print versionConvert a Markdown design doc to Typst:
md2typ docs/design.md --output docs/design.typConvert a report directly to PDF:
md2typ report.md --output report.pdfPipe Markdown from stdin:
cat notes.md | md2typ --output notes.pdfUse a custom template for professional formatting:
md2typ report.md --template examples/templates/academic.typ --output report.pdfRun unit tests:
cargo testFormat code:
cargo fmtLint:
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