Skip to content

Commit 3aeb4f3

Browse files
committed
do not remove JS added by Sphinx
1 parent 9ace345 commit 3aeb4f3

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

docs/source/conf.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -136,28 +136,17 @@ def get_holoviews_js_css():
136136
from holoviews.plotting import Renderer
137137
dependencies = {**Renderer.core_dependencies,
138138
**Renderer.extra_dependencies}
139-
required = ['jQuery', 'jQueryUI', 'underscore', 'require']
139+
required = ['jQueryUI'] # require, jQuery, and underscore are added by sphinx
140140
js = [url for name in required for url in dependencies[name].get('js', [])]
141141
css = [url for name in required for url in dependencies[name].get('css', [])]
142142
return js, css
143143

144144

145145
js, css = get_holoviews_js_css()
146-
html_context = {'holoviews_js_files': js}
147-
148-
149-
def remove_jquery_and_underscore(app):
150-
# We need to remove the jquery and underscore file that are
151-
# added by default because we already add it in the <head> tag.
152-
remove = lambda x: not any(js in x for js in ['jquery', 'underscore'])
153-
if hasattr(app.builder, 'script_files'):
154-
app.builder.script_files = [x for x in app.builder.script_files
155-
if remove(x)]
146+
html_context = {'holoviews_js_files': js} # used in source/_templates/layout.html
156147

157148

158149
def setup(app):
159150
for url in css:
160151
app.add_stylesheet(url)
161-
162152
app.add_stylesheet('custom.css') # For the `live_info` widget
163-
app.connect('builder-inited', remove_jquery_and_underscore)

0 commit comments

Comments
 (0)