Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/legneato/mdbook-typst
An mdBook backend to output Typst markup, pdf, png, or svg
https://github.com/legneato/mdbook-typst
Last synced: 18 days ago
JSON representation
An mdBook backend to output Typst markup, pdf, png, or svg
- Host: GitHub
- URL: https://github.com/legneato/mdbook-typst
- Owner: LegNeato
- Created: 2023-11-29T20:51:47.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-09-08T06:54:55.000Z (2 months ago)
- Last Synced: 2024-10-14T17:20:07.408Z (about 1 month ago)
- Language: Rust
- Homepage:
- Size: 87.9 KB
- Stars: 53
- Watchers: 2
- Forks: 3
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# `mdbook-typst`
`mdbook-typst` is a
[backend](https://rust-lang.github.io/mdBook/for_developers/backends.html) 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:
```sh
cargo install --git https://github.com/typst/typst
```Next, install `mdbook-typst` (this project):
```sh
cargo install mdbook-typst
```Then, add an entry to your
[book.toml]:```toml
[output.typst]
```Finally, build your book via mdBook:
```sh
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:
```toml
[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](./src/config.rs) for a complete list of options.If you want more control, consider creating your own formatter and/or preprocessing the
book using the [pullup](https://github.com/LegNeato/pullup) project.[mdBook]: https://github.com/rust-lang/mdBook
[book.toml]: https://rust-lang.github.io/mdBook/guide/creating.html#booktoml
[Typst]: https://typst.app/docs/