-
Notifications
You must be signed in to change notification settings - Fork 36
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
Update sphinx-tabs
to its latest version
#117
Conversation
sphinx-tabs
to its latest version
1a9fdb3
to
878ca2e
Compare
If `sphinx_tabs/tabs.js` is not found and `_static/tabs.js` is found, we trigger the function to render the tab manually.
878ca2e
to
9357a7f
Compare
This comment has been minimized.
This comment has been minimized.
(Sorry, this comment was supposed to go to #118) |
…itos/update-sphinx-tabs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable -- wishing for tests here at some point, since this feels hard to review and validate.
hoverxref/_static/js/hoverxref.js_t
Outdated
// Once the script has been executed, we remove it from the DOM | ||
script.parentNode.removeChild(script); | ||
} | ||
var src = $('script[src$="_static/tabs.js"]'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably use a different variable for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I renamed them to older_tab_src
and newer_tab_src
.
I'd like to have a small test suite for JS code too. I'll ask @agjohnson or @davidfischer probably to point myself in the right direction for a nice pattern and/or to some resources to learn from. |
Use two different selectors for sphinx-tabs<2 and >=2:
sphinx_tabs/tabs.js
_static/tabs.js
If the first one is used, the old code that adds a
script
tag is used. If the second one (sphinx-tabs>=2) is found, we call a small chunk of code to enable the tabs.Closes #104