You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If indeed this function is what is causing all of the slowness, how about instead of calling it multiple times, we generate the full HTML structure of the page's toctree one time, we store it in the page context as a beautifulsoup object, and then we re-use that object in building the actual sidebar / navbar HTML.
I think this might be a way to reduce redundant computation and maybe speed things up, it also feels a bit simpler to me.
The text was updated successfully, but these errors were encountered:
I realized that the proposal here will actually be more complex than I originally thought, because the caption elements aren't generated at the 2nd-and-below level.
Context
Right now we have have this function to generate either the navbar navigation or the sidebar navigation:
pydata-sphinx-theme/src/pydata_sphinx_theme/__init__.py
Lines 200 to 209 in 06a35ad
And we then re-use it in a few places to do the actual HTML generation:
It seems like this function in particular is time-consuming, and I wonder if this is true regardless of whether it's the sidebar/navbar variety. E.g.:
Idea
If indeed this function is what is causing all of the slowness, how about instead of calling it multiple times, we generate the full HTML structure of the page's toctree one time, we store it in the page context as a beautifulsoup object, and then we re-use that object in building the actual sidebar / navbar HTML.
I think this might be a way to reduce redundant computation and maybe speed things up, it also feels a bit simpler to me.
The text was updated successfully, but these errors were encountered: