tinymist/crates/typlite
Myriad-Dreamin 51db97ffcc
Some checks failed
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Has been cancelled
tinymist::ci / build-binary (push) Has been cancelled
tinymist::ci / build-vsc-assets (push) Has been cancelled
tinymist::ci / build-vscode (push) Has been cancelled
tinymist::ci / build-vscode-others (push) Has been cancelled
tinymist::ci / publish-vscode (push) Has been cancelled
feat: build theme-aware pictures (equations) (#1772)
* revert: "test: bad changes"

* feat: m1source
2025-06-05 11:10:04 +08:00
..
src feat: build theme-aware pictures (equations) (#1772) 2025-06-05 11:10:04 +08:00
Cargo.toml build: rearrange and test dependency meta (#1760) 2025-05-14 14:45:43 +08:00
dist.toml build: bump version to 0.12.14-rc1 (#1060) 2024-12-23 21:15:15 +08:00
README.md fix(typlite): recover readme (#1759) 2025-05-22 08:01:30 +08:00

Typlite

Converts a subset of typst to markdown.

Installation

cargo install typlite

Usage

# default output is main.md
typlite main.typ
# specify output
typlite main.typ output.md

Supported format:

  • output.txt: Plain text
  • output.md: Markdown
  • output.tex: LaTeX
  • output.docx: Word

Todo: We may support custom format by typst scripting in future, like:

# specify output
typlite main.typ --post-process @preview/typlite-mdx output.mdx

Feature

  • Contexual Content Rendering: Contents begin with context keyword will be rendered as svg output. The svg output will be embedded inline in the output file as base64 by default, if the --assets-path parameter is not specified. Otherwise, the svg output will be saved in the specified folder and the path will be embedded in the output file.

Typlite-Specific sys.inputs

The sys.input.x-target can be used distinguish with normal HTML export.

#let x-target = sys.input.at("x-target", default: "pdf")

#let my-function = if x-target == "md" {
  md-impl
} else {
  pdf-impl or html-impl
}