-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Add per page TOC in the rustc
book
#140113
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
Conversation
988a34a
to
b266992
Compare
cc @ehuss |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did play with the prototype quite a bit, and the per-page TOC looks very nice there to me (I tried various screen sizes and all the themes). I'll hand this review over to Eric who might have more clues about the book itself.
r? @ehuss (in case you have any concerns about the extra js/css of the book itself) |
6df24a0
to
4cbcb44
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm unless @ehuss has concerns
Thanks! A minor thing I noticed is that the colors don't work very well with the Rust theme, but that is not a blocker. @bors r+ rollup |
Add per page TOC in the `rustc` book 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](https://github.com/JorelAli/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).  Live preview at: http://urgau.rf.gd/book r? `@jieyouxu`
Add per page TOC in the `rustc` book 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](https://github.com/JorelAli/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).  Live preview at: http://urgau.rf.gd/book r? ``@jieyouxu``
Rollup of 7 pull requests Successful merges: - rust-lang#140113 (Add per page TOC in the `rustc` book) - rust-lang#140490 (split `asm!` parsing and validation) - rust-lang#140924 (Make some `f32`/`f64` tests also run in const-context) - rust-lang#141045 ([win][arm64] Remove 'Arm64 Hazard' undocumented MSVC option and instead disable problematic test) - rust-lang#141071 (Enable [behind-upstream] triagebot option for rust-lang/rust) - rust-lang#141132 (Use `crate::` prefix for root macro suggestions) - rust-lang#141139 (Fix Rust for Linux ping group label) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 8 pull requests Successful merges: - rust-lang#140113 (Add per page TOC in the `rustc` book) - rust-lang#140511 (Stabilize `#![feature(non_null_from_ref)]`) - rust-lang#140924 (Make some `f32`/`f64` tests also run in const-context) - rust-lang#140966 (Remove #![feature(let_chains)] from library and src/librustdoc) - rust-lang#141045 ([win][arm64] Remove 'Arm64 Hazard' undocumented MSVC option and instead disable problematic test) - rust-lang#141071 (Enable [behind-upstream] triagebot option for rust-lang/rust) - rust-lang#141132 (Use `crate::` prefix for root macro suggestions) - rust-lang#141139 (Fix Rust for Linux ping group label) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#140113 - Urgau:rustc-book-page-toc, r=ehuss Add per page TOC in the `rustc` book 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](https://github.com/JorelAli/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).  Live preview at: http://urgau.rf.gd/book r? ```@jieyouxu```
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).Live preview at: http://urgau.rf.gd/book
r? @jieyouxu