Skip to content

Replace mdBook with Typst - #416

Open
burrbull wants to merge 8 commits into
rust-embedded:masterfrom
burrbull:typst
Open

Replace mdBook with Typst#416
burrbull wants to merge 8 commits into
rust-embedded:masterfrom
burrbull:typst

Conversation

@burrbull

@burrbull burrbull commented Aug 1, 2026

Copy link
Copy Markdown
Member

This is my answer to multi-language book. cc @hwhsu1231

We can keep translations in same file if use Typst instead. See typ/intro/index.typ for example.

This is a draft yet, but it is already looks and works very similar to mdBook version as it reuses original CSS and scripts.

How to compile:
For html (Ukrainian language):

typst compile --features bundle,html -f bundle --input lang=uk typ/book-html.typ book-html-uk

and then copy html-assets content into book-html-uk

For PDF (German language): cc @braunharald

typst compile --input lang=de --input target=pdf typ/book-pdf.typ book-de.pdf

P.S. See rendered PDF https://github.com/burrbull/book/blob/d3105e73c217e17dd5ac42ca0e7f53d4fcac7fd7/book-en.pdf

@hwhsu1231

Copy link
Copy Markdown

Hello @burrbull,

Thank you for tagging me in this draft PR.

First of all, if you are asking for my opinion on this PR, I'm not entirely in favor of this change. Since you tagged me, I assume you've likely seen the rust-embedded-book-l10n project I announced in #401. Therefore, if rust-embedded/book migrates from mdBook to another documentation generator, this l10n project will no longer be able to function (unless the new tool also supports gettext-based internationalization).

Additionally, I noticed you mentioned the German translation in #415. If you are interested in translating The Embedded Rust Book, you are more than welcome to join the rust-embedded-book-l10n project! If German is not available yet, feel free to open an issue to request adding a new language. Once the requested language is added, you can start translating right away!

@burrbull

burrbull commented Aug 2, 2026

Copy link
Copy Markdown
Member Author

I've found that my mdbook binary was a "little" outdated.

Synchronized with new version. Also headings are fixed.

https://github.com/burrbull/book/blob/dae311b1d04524026f9f0943895a4f9d73eb6515/typ/intro/index.typ

@burrbull

burrbull commented Aug 2, 2026

Copy link
Copy Markdown
Member Author

CI caching does not work. What I did wrong?

All works as expected except one thing with sidebar in localized book.
When js is disabled iframe[ toc.html ] and it works well although it is not interactive.
When js is enabled magic toc.js works which always generates English table of contents.

P.S. It would be nice to add some html formatter in CI.

@burrbull
burrbull marked this pull request as ready for review August 2, 2026 16:54
@burrbull
burrbull requested a review from a team as a code owner August 2, 2026 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants