tinymist/crates/typlite
Myriad-Dreamin 3103f3933c
test(typlite): add more cases (#1719)
* test: add more cases

* test: update snapshot
2025-04-30 21:36:54 +08:00
..
src test(typlite): add more cases (#1719) 2025-04-30 21:36:54 +08:00
Cargo.toml test: typlite use snapshot_testing (#1717) 2025-04-30 20:31:02 +08:00
dist.toml build: bump version to 0.12.14-rc1 (#1060) 2024-12-23 21:15:15 +08:00
README.md docs(typlite): add examples for --assets-path and --assets-src-path (#1396) 2025-02-25 15:30:46 +08:00

Typlite

Converts a subset of typst to markdown.

Basic Usage

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

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. By specify the --assets-src-path parameter, the source code of the context will also be saved in the specified folder.

    For example, the following folder structure is generated by the following command:

    typlite main.typ --assets-path assets --assets-src-path assets-src
    
    .
    ├── assets # when --assets-path is specified
    │   ├── 1_Dark.svg
    │   └── 1_Light.svg
    ├── assets-src # when --assets-src-path is specified
    │   └── 1.typ # 1 is the numbering of the context block
    ├── main.md # output file
    └── main.typ # input file
    
  • Raw Output: Raw codes with typlite language will be directly output into the Markdown result.