5050 'sphinx.ext.napoleon' ,
5151 'jupyter_sphinx.execute' ,
5252 'sphinx_fontawesome' ,
53- 'm2r'
53+ 'm2r' ,
5454]
5555
5656source_parsers = {}
@@ -136,7 +136,7 @@ def get_holoviews_js_css():
136136 from holoviews .plotting import Renderer
137137 dependencies = {** Renderer .core_dependencies ,
138138 ** Renderer .extra_dependencies }
139- required = ['jQuery' , 'jQueryUI' , 'require' ]
139+ required = ['jQuery' , 'jQueryUI' , 'underscore' , ' require' ]
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
@@ -146,9 +146,18 @@ def get_holoviews_js_css():
146146html_context = {'holoviews_js_files' : js }
147147
148148
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 )]
156+
157+
149158def setup (app ):
150159 for url in css :
151160 app .add_stylesheet (url )
152161
153162 app .add_stylesheet ('custom.css' ) # For the `live_info` widget
154- app .add_javascript ( "https://unpkg.com/@jupyter-widgets/html-manager@0.14.4/dist/embed-amd.js" )
163+ app .connect ( 'builder-inited' , remove_jquery_and_underscore )
0 commit comments