Add underscore.js to the sphinx13 theme (#10588)

This commit is contained in:
Adam Turner 2022-06-19 23:12:38 +01:00 committed by GitHub
parent 0796f7065a
commit b26bf0320c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -9,6 +9,11 @@
*
*/
/**
* select a different prefix for underscore
*/
$u = _.noConflict();
/**
* small helper function to urldecode strings

View File

@ -181,7 +181,9 @@ def setup(app):
# Load jQuery and patches to make readthedocs-doc-embed.js available (refs: #10574)
app.add_js_file('https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js',
priority=100)
app.add_js_file('_sphinx_javascript_frameworks_compat.js', priority=200)
app.add_js_file('https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.13.1/underscore-min.js', # NoQA
priority=100)
app.add_js_file('_sphinx_javascript_frameworks_compat.js', priority=105)
# workaround for RTD
from sphinx.util import logging