-
Notifications
You must be signed in to change notification settings - Fork 352
Closed
Description
Ever since this theme has existed, building the left navigation bar has been a big pain in the butt. I think this is partially because we're using our own kind-of hacky code to generate that TocTree manually, and we run into weird edge-cases where things don't behave as expected.
So, I was wondering what folks thought about this:
- Use the regular Sphinx
toctree()
function (incontext["toctree"]()
). This will output the HTML for the toctree, but it won't have the classes etc that we need. - Use
BeautifulSoup
to manipulate the HTML that is generated, remove the pieces we don't want (e.g. top-level headers of non-active pages), and add the tags where we want them.
I feel like manipulating HTML via bs4
could be cleaner than manipulating the docutils tree structure, and we'd have the benefit of using the default Sphinx toctree, which should make this behave more predictably.
Curious what folks think about that...
Metadata
Metadata
Assignees
Labels
No labels