-
Notifications
You must be signed in to change notification settings - Fork 3.1k
spec: generated TOC, with linkable headers and return to top links #3996
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
This adds a table of contents to the spec, with a way to get the link of a header on hover (like on GitHub) and a "return to top" small icon at the end of each section. Jekyll generates the H1-level table of contents, and then the current one is expended using jQuery all the way down to H5 titles. Examples and H6 headers are ignored. GitHub's (MIT licensed) octicons are used for nice "link" and "up" icons.
That's quite an advance for civilization, Herr Gutenberg. |
LGTM Brilliant! I also tested on Chrome on iPhone, the right-hand-side sidebar is unobtrusive there. Next on my wish list:
|
Well, what am I supposed to say? Must be a tradition that everything already done gets redone multiple times. (Edit: No snark, just sadness.) |
...and a Scala favicon.
@soc oh, I feel like an idiot now, I hadn't realized that you had done that already. When I opened your version of the spec, there was no TOC at all. Going back to it, I just realized it didn't show up because my screen isn't wide enough: below ~1390px-wide there is only the content. That what I get for using a lateral tab bar... |
@gourlaysama Hey, no problem. I lament the process which enables this, not persons. |
@retronym I pushed two new commits:
I added a banner on top with the logo (from the many logos available in the scala-lang repo). Ideas welcome :)
Fixed
You mean a "Scala Language Specification" header on top, or something more? Maybe showing a "Index" entry in the TOC? |
LGTM. I'm going to merge this but I'd encourage other speciphiles to take a look over the finished article in search of any problems with the sidebar layout. |
spec: generated TOC, with linkable headers and return to top links
This adds a table of contents to the spec, with a way to get the link of a
header on hover (like on GitHub) and a "return to top" small icon at the
end of each section.
Jekyll generates the H1-level table of contents, and then the current
one is expended using jQuery all the way down to H5 titles. Examples and
H6 headers are ignored.
GitHub's (MIT licensed) octicons are used for nice "link" and "up"
icons.
Online preview here. It looks fine in Firefox (32) and Chrome (37) (and even, surprisingly, in IE8).
I just realized there is no particular reason for the TOC being on the right. I guess I was in a right-hand-side mood. I can move it to the left if needed...
review @retronym @som-snytt /cc @soc