-
Notifications
You must be signed in to change notification settings - Fork 5
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
Global table of contents #12
Comments
Hi @lancegoyke — you win the first not-me issue prize 🎁 The short answer will be yes we can add this. The global toctree is generated by sphinx, so we just need to look at how/where that goes and pull it into the Django template. As well as the Sphinx Book Theme, the Furo theme has similar (and good docs/notes.) Totally keen to add this 😄 |
This looks promising: https://github.com/statease/sphinx-jsontoc-builder
But it shows the path forward. |
I am HONORED to accept this prize. I'd like to thank my parents, my friends... Small joke. I would be happy to try to help with this, Carlton, but I'm quite inexperienced and don't want to cause more work than is necessary! I spent a few hours today diving into that package you linked and it looks promising. |
Hi @lancegoyke — I think if you just adjust the make file to use the builder from that package it would "Just Work™" — enough to get up and running with anyway, which would give time to work on templates and our own adjustments to the I'd be interested to see how far you got. (It's something I'll play with myself, but maybe not for another month or so.) |
Hey @carltongibson — I got a second wind and some time this weekend and make some headway. Steps First, I copied over the files from Made a new directory for extensions: Made a new directory for the builder extension: Two new files in there:
Then I added the new builder directory to the Sphinx will build with The "toctree" HTML shows up in the template context. I got it to render with Overall positive. It took a while to figure out how Sphinx was recognizing it, but I think it makes sense to me now. New Problem I now have the global ToC rendering twice on my main index.md page:
I haven't had any time to play around with that, though, gotta call it a night for now! |
Hey @lancegoyke — that sounds like good progress! This is something we're definitely going to want so I think adding a custom builder ourselves will be the way forward.
🤔 OK, so we'd need to add some page metadata: either saying "show ToC" or (maybe) selecting the template to use... |
Closed by #15. |
Follow-up in #17. |
If this is outside the scope of django-sphinx-view, please feel free to close this.
I've been playing around with this package as a builder for fitness courses. I saw your talk, Carlton, and thought Sphinx + Django might work well for permission restricted access to courses.
For extensive online content, I find a global Table of Contents helpful in keeping the reader oriented and reminded of what they've learned already and what is still to come.
An example would be the Sphinx Book Theme, where there's a global ToC on the left and a document ToC on the right:
The local "toc" block supplied in the json output works wonders. Is there a way to render a similar toc but for the entire toctree structure? Perhaps with the "active" page tagged with a CSS class?
I could very well be missing something fundamental about the toctree directive. I've tried adding a new theme and combing through the json output, but no luck yet.
The text was updated successfully, but these errors were encountered: