tinymist/crates/typlite
Myriad-Dreamin 1210b54515
Some checks are pending
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2022) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
feat: finally directly generate markdown files (#1881)
* feat: finally directly generate markdown files

* fix: trim

* fix: await
2025-07-07 13:11:23 +08:00
..
src feat: finally directly generate markdown files (#1881) 2025-07-07 13:11:23 +08:00
Cargo.toml build: generate docs with internal links (#1831) 2025-06-22 15:28:27 +08:00
dist.toml build: enable typlite distribution in dist.toml (#1810) 2025-06-12 18:05:37 +08:00
README.md feat: finally directly generate markdown files (#1881) 2025-07-07 13:11:23 +08:00

Typlite

Converts a subset of typst to markdown.

Installation

Install prebuilt binaries via shell script

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/Myriad-Dreamin/tinymist/releases/download/v0.13.14/typlite-installer.sh | sh

Install prebuilt binaries via powershell script

powershell -ExecutionPolicy Bypass -c "irm https://github.com/Myriad-Dreamin/tinymist/releases/download/v0.13.14/typlite-installer.ps1 | iex"

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.inputs.at("x-target", default: "pdf")

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