#mdbook #typst #png #markup #pdf #svg #back-end

app mdbook-typst

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

3 releases

0.1.2 Mar 3, 2024
0.1.1 Dec 1, 2023
0.1.0 Dec 1, 2023

#305 in Text processing

Download history 2/week @ 2024-02-18 25/week @ 2024-02-25 146/week @ 2024-03-03 18/week @ 2024-03-10 10/week @ 2024-03-17 65/week @ 2024-03-31 8/week @ 2024-04-07 6/week @ 2024-04-14

82 downloads per month

MIT/Apache

26KB
634 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

Finally, add an entry to your book.toml:

[output.typst]

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

~13–24MB
~347K SLoC