Closed matthewlawrenceklein closed 2 years ago
Hey @matthewlawrenceklein, this is great! Thank you. I can see that its working with the 2016/06/22/anvio-tutorial-v2/
as shown in your screen capture, but it is not working with tutorials/infant-gut/
or data/fmt-gut-colonization/
.
Plus, I was wondering if we can center the highlighted cell in TOC vertically. When the TOC is too long, the highlight disappears as you scroll through the page (you can see it by making your browser's height tiny).
@ekiefl are you able to chime in here? I recall you noticed some broken links in the infant gut
tutorial, but I'm not totally sure what could be responsible for the breakage. My understanding is that the jekyll-toc
script runs through each html page, rips out anything in an <h_>
tag, and uses the h value to set/nest items in the toc display. Since our posts/tutorials start as markdown files and uniformly use the #
syntax to denote headers, I'm not sure why the end result would differ from page to page.
@meren, as I navigate across the site, the toc patch appears to be working as intended for the majority of pages I visit, but definitely not all. I'll keep poking around!
I recall you noticed some broken links in the infant gut tutorial, but I'm not totally sure what could be responsible for the breakage.
You're right. I forget the exact details, but you can test if the links are working by clicking each one--if your scrollview doesn't update to that position, the hyperlink is broken/outdated. I assumed that was the cause, but it may not be. Another idea I have is to look at the md
file for the infant gut. It may have some include statements about toc that override the changes you made.
thank you, @matthewlawrenceklein! it is now in the main branch :)
Thank you @matthewlawrenceklein and @meren!
this patch preserves the initial highlighting functionality of the table of contents. A new file,
toc.js
, has been directly injected into the_toc.html
file in theincludes
directory, and the relevant code has been migrated over from the_main.js
file. Some CSS has been rewritten to target the previous TOC implementation.