sphinx_rtd_theme
sphinx_rtd_theme copied to clipboard
Refactor the enable() function in theme.js
Problem
The enable()
function in theme.js
is called by the application to initialize the versions flyout menu that is used in all versions.
This function, however, is also performing DOM operations that are specific to sphinx_rtd_theme
.
Details
The functions inserts html elements and adds several classes that are used by the sphinx_rtd_theme
.
Solution
Refactor this function to use two separate methods. One for all versions/builds and one that is only executed when the theme is a derivative of sphinx_rtd_theme. The code that adds wy-table-responsive
would be an example of code that should only be executed when the theme is a sphinx_rtd_theme derivative.
Related issues
The conversation about this problem started here:
- https://github.com/readthedocs/readthedocs.org/issues/8497