-
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
base: master
Are you sure you want to change the base?
Conversation
988a34a
to
b266992
Compare
@@ -0,0 +1,104 @@ | |||
/* Inspired by https://github.com/JorelAli/mdBook-pagetoc/ */ |
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.
@davidtwco @wesleywiser, legal question here, pagetoc.css
and pagetoc.js
are both heavily inspired by https://github.com/JorelAli/mdBook-pagetoc/ which is licensed under the "WTFPL" license (Do What The F*ck You Want To Public License).
Is it okay for us to re-license those files under our dual license MIT/Apache-2?
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 will start a thread with the Foundation to see what they think.
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) |
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