|
26 | 26 | # list see the documentation: |
27 | 27 | # https://www.sphinx-doc.org/en/master/usage/configuration.html |
28 | 28 |
|
29 | | -# -- Path setup -------------------------------------------------------------- |
30 | | - |
31 | 29 | import datetime |
32 | 30 | import os |
33 | 31 | import sys |
@@ -60,8 +58,7 @@ def get_years(start_year=2021): |
60 | 58 |
|
61 | 59 | #https://github.com/spatialaudio/nbsphinx/issues/128#issuecomment-1158712159 |
62 | 60 | html_js_files = [ |
63 | | - "require.min.js", # Add to your _static |
64 | | - "custom.js", |
| 61 | + "https://cdn.plot.ly/plotly-latest.min.js", # Add Plotly.js |
65 | 62 | ] |
66 | 63 |
|
67 | 64 | extensions = [ |
@@ -133,8 +130,11 @@ def get_years(start_year=2021): |
133 | 130 | # directories to ignore when looking for source files. |
134 | 131 | # This pattern also affects html_static_path and html_extra_path. |
135 | 132 | exclude_patterns = [ |
136 | | - "**/todo", "**/src", "cebra-figures/figures.rst", "cebra-figures/*.rst", |
137 | | - "*/cebra-figures/*.rst", "demo_notebooks/README.rst" |
| 133 | + "**/todo", |
| 134 | + "**/src", |
| 135 | + "cebra-figures/figures.rst", |
| 136 | + "cebra-figures/*.rst", |
| 137 | + "*/cebra-figures/*.rst" #, "demo_notebooks/README.rst" |
138 | 138 | ] |
139 | 139 |
|
140 | 140 | # -- Options for HTML output ------------------------------------------------- |
@@ -185,23 +185,26 @@ def get_years(start_year=2021): |
185 | 185 | "icon": "fas fa-graduation-cap", |
186 | 186 | }, |
187 | 187 | ], |
188 | | - "external_links": [ |
189 | | - # {"name": "Mathis Lab", "url": "http://www.mackenziemathislab.org/"}, |
190 | | - ], |
191 | 188 | "collapse_navigation": False, |
192 | | - "navigation_depth": 4, |
| 189 | + "navigation_depth": 1, |
193 | 190 | "show_nav_level": 2, |
194 | 191 | "navbar_align": "content", |
195 | 192 | "show_prev_next": False, |
| 193 | + "navbar_end": ["theme-switcher", "navbar-icon-links.html"], |
| 194 | + "navbar_persistent": [], |
| 195 | + "header_links_before_dropdown": 7 |
196 | 196 | } |
197 | 197 |
|
198 | | -html_context = {"default_mode": "dark"} |
| 198 | +html_context = {"default_mode": "light"} |
199 | 199 | html_favicon = "_static/img/logo_small.png" |
200 | 200 | html_logo = "_static/img/logo_large.png" |
201 | 201 |
|
202 | | -# Remove the search field for now |
| 202 | +# Replace with this configuration to enable "on this page" navigation |
203 | 203 | html_sidebars = { |
204 | | - "**": ["search-field.html", "sidebar-nav-bs.html"], |
| 204 | + "**": ["search-field.html", "sidebar-nav-bs", "page-toc.html"], |
| 205 | + "demos": ["search-field.html", "sidebar-nav-bs"], |
| 206 | + "api": ["search-field.html", "sidebar-nav-bs"], |
| 207 | + "figures": ["search-field.html", "sidebar-nav-bs"], |
205 | 208 | } |
206 | 209 |
|
207 | 210 | # Disable links for embedded images |
@@ -289,3 +292,12 @@ def get_years(start_year=2021): |
289 | 292 | """ |
290 | 293 | # fmt: on |
291 | 294 | # flake8: enable=E501 |
| 295 | + |
| 296 | +# Configure nbsphinx to properly render Plotly plots |
| 297 | +nbsphinx_execute = 'auto' |
| 298 | +nbsphinx_allow_errors = True |
| 299 | +nbsphinx_requirejs_path = 'https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.7/require.js' |
| 300 | +nbsphinx_execute_arguments = [ |
| 301 | + "--InlineBackend.figure_formats={'png', 'svg', 'pdf'}", |
| 302 | + "--InlineBackend.rc=figure.dpi=96", |
| 303 | +] |
0 commit comments