|
47 | 47 | 'sphinx.ext.mathjax', |
48 | 48 | 'sphinx.ext.viewcode', |
49 | 49 | 'sphinx.ext.napoleon', |
| 50 | + 'jupyter_sphinx.execute', |
50 | 51 | ] |
51 | 52 |
|
52 | 53 | source_parsers = {} |
|
86 | 87 | # |
87 | 88 | html_theme = 'sphinx_rtd_theme' |
88 | 89 |
|
| 90 | + |
89 | 91 | # Theme options are theme-specific and customize the look and feel of a theme |
90 | 92 | # further. For a list of options available for each theme, see the |
91 | 93 | # documentation. |
|
113 | 115 | # Output file base name for HTML help builder. |
114 | 116 | htmlhelp_basename = 'adaptivedoc' |
115 | 117 |
|
| 118 | + |
116 | 119 | # -- Extension configuration ------------------------------------------------- |
117 | 120 |
|
118 | 121 | default_role = 'autolink' |
119 | 122 |
|
120 | | -intersphinx_mapping = {'python': ('https://docs.python.org/3', None), |
121 | | - 'distributed': ('https://distributed.readthedocs.io/en/stable/', None), |
122 | | - 'holoviews': ('https://holoviews.org/', None), |
123 | | - 'ipyparallel': ('https://ipyparallel.readthedocs.io/en/stable/', None), |
124 | | - 'scipy': ('https://docs.scipy.org/doc/scipy/reference', None), |
| 123 | +intersphinx_mapping = { |
| 124 | + 'python': ('https://docs.python.org/3', None), |
| 125 | + 'distributed': ('https://distributed.readthedocs.io/en/stable/', None), |
| 126 | + 'holoviews': ('https://holoviews.org/', None), |
| 127 | + 'ipyparallel': ('https://ipyparallel.readthedocs.io/en/stable/', None), |
| 128 | + 'scipy': ('https://docs.scipy.org/doc/scipy/reference', None), |
125 | 129 | } |
| 130 | + |
| 131 | + |
| 132 | +def get_holoviews_js_css(): |
| 133 | + from holoviews.plotting import Renderer |
| 134 | + dependencies = {**Renderer.core_dependencies, |
| 135 | + **Renderer.extra_dependencies} |
| 136 | + required = ['jQueryUI', 'jQuery', 'require'] |
| 137 | + js = [url for name in required for url in dependencies[name].get('js', [])] |
| 138 | + css = [url for name in required for url in dependencies[name].get('css', [])] |
| 139 | + return js, css |
| 140 | + |
| 141 | + |
| 142 | +js, css = get_holoviews_js_css() |
| 143 | +html_context = {'holoviews_js_files': js} |
| 144 | + |
| 145 | + |
| 146 | +def setup(app): |
| 147 | + for url in css: |
| 148 | + app.add_stylesheet(url) |
| 149 | + |
| 150 | + app.add_javascript("https://unpkg.com/@jupyter-widgets/html-manager@0.14.4/dist/embed-amd.js") |
0 commit comments