#mdbook #typst #png #markup #pdf #svg #output-format

app mdbook-typst

An mdBook backend to output Typst markup, pdf, png, or svg

8 releases

0.1.7 Oct 29, 2024
0.1.6 Sep 8, 2024
0.1.4 Jun 16, 2024
0.1.2 Mar 3, 2024
0.1.1 Dec 1, 2023

#296 in Text processing

Download history 1/week @ 2024-08-30 297/week @ 2024-09-06 59/week @ 2024-09-13 38/week @ 2024-09-20 20/week @ 2024-09-27 15/week @ 2024-10-04 13/week @ 2024-10-11 10/week @ 2024-10-18 124/week @ 2024-10-25 31/week @ 2024-11-01 17/week @ 2024-11-08 14/week @ 2024-11-15 10/week @ 2024-11-22 1/week @ 2024-11-29 29/week @ 2024-12-06

55 downloads per month

MIT/Apache

27KB
654 lines

mdbook-typst

mdbook-typst is a backend for mdBook. The backend converts the book to Typst markup and can output any format Typst can (currently pdf, png, svg, and raw Typst markup).

Usage

First, install the Typst cli:

cargo install --git https://github.com/typst/typst

Next, install mdbook-typst (this project):

cargo install mdbook-typst

Then, add an entry to your book.toml:

[output.typst]

Finally, build your book via mdBook:

mdbook build

By default mdbook-typst will output raw Typst markup to book/typst/book.typst.

Pdf and other formats

Pdf and other formats can be output instead of raw Typst markup. In your book.toml set the format value of the output config section:

[output.typst.output]
format = "pdf"

By default mdbook-typst will output to book/typst/book.[format].

Other configuration

mdbook-typst is fairly configurable. Check out the configuration code for a complete list of options.

If you want more control, consider creating your own formatter and/or preprocessing the book using the pullup project.

Dependencies

~14–25MB
~371K SLoC