Add per page TOC in the rustc book by Urgau · Pull Request #140113 · rust-lang/rust (original) (raw)

This PR adds per page Table of Content (TOC) in the rustc book (to be extended in the future to our other books).

The goal is to easy the navigation inside the page by providing quick overview of the page content and our position inside that page.

That functionality is unfortunately not available natively in mdbook, which prompted community members to create mdBook-pagetoc (which this PR is heavily inspired by). It's "only" a JS file (to handle the TOC) and a CSS file (to handle the margin, colors, screen size, ...), there is no "post-processor" needed (in mdbook sense).

image

Live preview at: http://urgau.rf.gd/book

r? @jieyouxu