Skip to content

Update mdBook - #306

Draft
parasyte wants to merge 4 commits into
mainfrom
update/mdbook
Draft

Update mdBook#306
parasyte wants to merge 4 commits into
mainfrom
update/mdbook

Conversation

@parasyte

Copy link
Copy Markdown
Collaborator

This is a Work-In-Progress. Depends on installing some preprocessors from git for unpublished fixes. Looks nice, though!


This replaces the pagetoc sidebar hack that I put together with the native sidebar-header-nav feature in mdBook 0.5.

See: https://rust-lang.github.io/mdBook/format/configuration/renderers.html#html-renderer-options

The mdbook-tera templates were giving me grief in algorithms.md. Using a * or - bullet inside a raw template block causes tera to discard everything after the block. Indentation works around the problem. I don't know why!

mdbook-bib changed their renderer and CSS, which looks nicer. I made some minor patches to the new CSS that desaturates the links slightly, matching the custom CSS for all other links.

Removed a couple of things from book.toml that are no longer needed.

Added an admonition to the index page, replacing our naive attempt at a warning with one that properly stands out.

mdbook-mermaid and mdbook-tera are pinned to git because they have some unreleased patches that we need.

This replaces the pagetoc sidebar hack that I put together with the
native `sidebar-header-nav` feature in mdBook 0.5.

See: https://rust-lang.github.io/mdBook/format/configuration/renderers.html#html-renderer-options

The `mdbook-tera` templates were giving me grief in algorithms.md.
Using a `*` or `-` bullet inside a raw template block causes `tera`
to discard everything after the block. Indentation works around the
problem. I don't know why!

`mdbook-bib` changed their renderer and CSS, which looks nicer.
I made some minor patches to the new CSS that desaturates the
links slightly, matching the custom CSS for all other links.

Removed a couple of things from book.toml that are no longer needed.

Added an admonition to the index page, replacing our naive attempt
at a warning with one that properly stands out.

`mdbook-mermaid` and `mdbook-tera` are pinned to git because they
have some unreleased patches that we need.
This flag builds the preprocessors with an older version of the
`mdbook-preprocessor` crate, which causes mdBook to print a warning.
It's harmless (no changes to that crate between the versions - they
stay in lock-step with the main `mdbook` crate).

But removing this flag also means picking up vulnerability fixes.

It also means exposing ourselves to supply-chain attacks.

Can't win all the time!
Comment thread README.md Outdated
@danpape

danpape commented Mar 19, 2026

Copy link
Copy Markdown
Collaborator

Looks nice!

Only thing I noticed so far--clicking on a chapter name in the sidebar twice does not close the expanded sublist. For instance, click on "3. Terminology" twice. Not sure if that's possible or not.

I didn't notice this at all! The `mdbook` directory no longer exists. 😂
@parasyte

Copy link
Copy Markdown
Collaborator Author

I don't see a way to collapse the sidebar-header-nav. Even enabling section-folding doesn't do it.

Didn't find an upstream feature request for it, so I created one: rust-lang/mdBook#3054

@danpape

danpape commented May 26, 2026

Copy link
Copy Markdown
Collaborator

@parasyte , any ideas if we can move forward with these changes? I'd hate to lose the improvements you made.

@parasyte

Copy link
Copy Markdown
Collaborator Author

It needs the plugins patched with the commit IDs shown in the GitHub actions YAML. Neither of them are merged upstream. You can move forward with this in its present state. It might just be permanently on third party forks for the dependencies. And there is no guarantee those forks will stay around.

Forking them into the dcdpr account would be wise, if you want to go that route. It would ensure the builds are always reproducible.

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