5 个版本
0.1.4 | 2024 年 6 月 16 日 |
---|---|
0.1.3 | 2024 年 6 月 16 日 |
0.1.2 | 2024 年 3 月 3 日 |
0.1.1 | 2023 年 12 月 1 日 |
0.1.0 | 2023 年 12 月 1 日 |
#220 in 文本处理
26KB
631 代码行
mdbook-typst
mdbook-typst
是 后端,用于 mdBook。后端将书籍转换为 Typst 标记,并可输出 Typst 支持的任何格式(目前为 pdf
、png
、svg
和原始的 Typst 标记)。
用法
首先安装 Typst 命令行工具
cargo install --git https://github.com/typst/typst
然后安装 mdbook-typst
(此项目)
cargo install mdbook-typst
最后,在你的 book.toml 文件中添加条目
[output.typst]
默认情况下,mdbook-typst
将将原始 Typst 标记输出到 book/typst/book.typst
。
Pdf 和其他格式
Pdf 和其他格式可以输出,而不是原始 Typst 标记。在你的 book.toml 文件中设置 output
配置部分的 format
值
[output.typst.output]
format = "pdf"
默认情况下,mdbook-typst
将输出到 book/typst/book.[format]
。
其他配置
mdbook-typst
具有相当多的配置选项。查看 配置代码 获取完整的选项列表。
如果您需要更多控制,可以考虑创建自己的格式化程序或使用 pullup 项目对书籍进行预处理。
依赖关系
~13–24MB
~351K SLoC