-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Add 'active' class to current page in rustbook table of contents #25551
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
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see CONTRIBUTING.md for more information. |
Nice! I've been meaning to add something like this as well. I'm no authority, but |
Thanks! Would it be possible to upload a preview of these docs as well? |
Here you go @alexcrichton: http://cllns.com/rustbook/ (this link will not work once this PR is closed) @killercup thanks for the suggestion! If someone else also prefers to not have the current page underlined, I'll change it :) |
I like it 👍 |
…toc, r=alexcrichton Currently the table of contents for `rustbook` doesn't signify which page you are on. This PR adds an 'active' class to the link for the current page, and defines the CSS rule for that class to make the link underlined and bold. Not sure about two things: 1) Is `current_page` is a good name for the function parameter? At first I thought `current_item` would be good, but then in the `walk_item` function, you'd have `item` and `current_item`. 2) For the CSS, is both bold and underline too much? At first I had it just be underlined, but that's also how the links look when they're hovered over.
…toc, r=alexcrichton Currently the table of contents for `rustbook` doesn't signify which page you are on. This PR adds an 'active' class to the link for the current page, and defines the CSS rule for that class to make the link underlined and bold. Not sure about two things: 1) Is `current_page` is a good name for the function parameter? At first I thought `current_item` would be good, but then in the `walk_item` function, you'd have `item` and `current_item`. 2) For the CSS, is both bold and underline too much? At first I had it just be underlined, but that's also how the links look when they're hovered over.
Currently the table of contents for
rustbook
doesn't signify which page you are on.This PR adds an 'active' class to the link for the current page, and defines the CSS rule for that class to make the link underlined and bold.
Not sure about two things:
Is
current_page
is a good name for the function parameter? At first I thoughtcurrent_item
would be good, but then in thewalk_item
function, you'd haveitem
andcurrent_item
.For the CSS, is both bold and underline too much? At first I had it just be underlined, but that's also how the links look when they're hovered over.