-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate to rinja #2487
base: master
Are you sure you want to change the base?
Migrate to rinja #2487
Conversation
In the current version of mdBook, This PR seems to remove that functionality. I don't think that's a good idea without first taking stock of customization that popular books use, helping them migrate over to some better way(s) to accomplish the same things, and only then deprecating and removing support for custom hbs. In any case, you really need to mention stuff like that in the PR description. |
I didn't realize it was a feature. I saw a test checking that but didn't check further, should have. Gonna investigate. |
|
rust-by-example has a custom language picker, and zjp-cn has a custom TOC. #2490 adds their own logo. |
The custom TOC is actually to add something that was missing at the time: TOC for headings in the current page. For rust-by-example it could be switched to JS. So in here, I think we'll need to discuss more th @ehuss to see if adding options On one hand, it would make But in any case, I think the code simplification and having template errors at compile-time is a big plus. Waiting to hear from @ehuss then. :) |
Main argument for switching to rinja: compilation fails if your template is invalid. It also generates very performant code (as can be seen here).
Some extra advantages: it makes the code simpler to follow. Storing everything into a JSON map made it pretty tricky to understand what was going on and needed to have a lot more checks in the code.
With this JSON map gone, I also simplified code to handle chapter kinds: it's now a
Chapter
enum, making it easier to understand.Last point: rustdoc, docs.rs and clippy lints page already switched to rinja so I think it tells a lot about how reliable
rinja
is. :)Considering how big the PR is, please don't hesitate to ask me if anything is unclear.