Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
DOC: Add a JupyterLite-powered REPL to the Matplotlib documentation's landing page, and enable interactive galleries#29506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Changes fromall commits
fae43c3e5ecaac2374f557c75115c92ca2147b4b42251ab4b5194b897c7dce79786561ede0d710faaf525ebdd52a26fbf32ccd3693601e383e08f5ff74bec7542294022ce55934611e1c170ede30786115ec29f3759f78c4fed028d8d63dacf3a7373faa465451ae6286a5f7c55fe769f0d4de46ad6e4694e4246260d3d7a60b9d0File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -102,6 +102,16 @@ def _parse_skip_subdirs_file(): | ||
| # usage in the gallery. | ||
| warnings.filterwarnings('error', append=True) | ||
| # Prevent Sphinx-Gallery and jupytext incompatibility warning. This is spurious | ||
| # and can be ignored for our use case. This has to be added before importing | ||
| # jupyterlite_sphinx below, so that we can block the warning before it is raised. | ||
| # TODO: Fix this in jupyterlite-sphinx | ||
agriyakhetarpal marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| # https://github.com/jupyterlite/jupyterlite-sphinx/issues/258 | ||
| warnings.filterwarnings('ignore', category=UserWarning, | ||
| message=( | ||
| r'(\n|.)*Sphinx Gallery in version 0.18.0 is not ' | ||
| r'supported by Jupytext')) | ||
| # Add any Sphinx extension module names here, as strings. They can be | ||
| # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. | ||
| extensions = [ | ||
| @@ -128,7 +138,7 @@ def _parse_skip_subdirs_file(): | ||
| 'sphinxext.redirect_from', | ||
| 'sphinx_copybutton', | ||
| 'sphinx_design', | ||
| 'jupyterlite_sphinx', | ||
| ] | ||
| exclude_patterns = [ | ||
| @@ -305,6 +315,10 @@ def autodoc_process_bases(app, name, obj, options, bases): | ||
| 'within_subsection_order': gallery_order_subsectionorder, | ||
| 'capture_repr': (), | ||
| 'copyfile_regex': r'.*\.rst', | ||
| # Disable Sphinx-Gallery's JupyterLite integration until there's | ||
| # further notice. It comes from our usage of jupyterlite-sphinx | ||
| # as a registered extension. | ||
| 'jupyterlite': None, | ||
| } | ||
| if parse_version(sphinx_gallery.__version__) >= parse_version('0.17.0'): | ||
| @@ -767,6 +781,23 @@ def js_tag_with_cache_busting(js): | ||
| 1), | ||
| ] | ||
| # JupyterLite config | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Is there a way this can be disabled by default and enabled by a flag? This could be set on CI and in release mode. I'm not sure we want to be paying the build costs locally for every developer. But since the build failed, I'm not sure exactly how large that build time cost is, so itcould be negligible for all I know. Author
| ||
| jupyterlite_bind_ipynb_suffix = False | ||
| # Include the gallery examples in the JupyterLite deployment. | ||
| # .zip,.png,.gif, .json and other extra file formats generated by | ||
| # Sphinx-Gallery are ignored via the LiteBuildConfig/extra_ignore_contents | ||
| # key in the jupyter_lite_config.json file. | ||
| jupyterlite_contents = ["gallery/**"] | ||
| # Set this to False to aid debugging locally or in CI. It is silenced | ||
| # by default as there is no way to disable the JupyterLite output in | ||
| # parts right now, and it can be quite verbose. | ||
| jupyterlite_silence = False # set to False when merging | ||
| jupyterlite_build_command_options = { | ||
| "XeusAddon.environment_file": "jupyterlite_environment.yml", | ||
| } | ||
| # numpydoc config | ||
| numpydoc_show_class_members = False | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "jupyter-lite-schema-version": 0, | ||
| "jupyter-config-data": { | ||
| "disabledExtensions": [ | ||
| "@jupyterlite/javascript-kernel-extension", | ||
| "@jupyterlite/pyodide-kernel-extension" | ||
| ], | ||
| "contentsStorageName": "JupyterLite Matplotlib Docs Storage" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Why is there a Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I've always been confused about this myself. One is for the CLI, one is for the JupyterLite frontend. The naming is pretty bad. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. The JupyterLite CLI is a
Agree this can be confusing. Maybe JupyterLite could also support loading For more information:https://jupyterlite.readthedocs.io/en/stable/howto/configure/config_files.html | ||
| "LiteBuildConfig": { | ||
| "extra_ignore_contents": ["\\.(rst|zip|pickle|py|json|svg|md5|png|gif)"], | ||
| "no_unused_shared_packages":true, | ||
| "no_sourcemaps":true | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # This environment file is added via the XeusAddon.environment_file | ||
| # key in the jupyterlite_build_command_options dict in conf.py. See | ||
| # https://jupyterlite-sphinx.readthedocs.io/en/stable/configuration.html | ||
| # for more information on additional configuration options. | ||
| --- | ||
| name: mpl-wasm-docs | ||
| channels: | ||
| - https://repo.mamba.pm/emscripten-forge | ||
| - conda-forge | ||
| dependencies: | ||
| # for examples in the gallery | ||
| # temporary: pin NumPy to <2 for now, see https://github.com/emscripten-forge/recipes/issues/1766 | ||
| - numpy==1.26.4 | ||
| - matplotlib | ||
| - ipympl | ||
| # a kernel for running them | ||
| - xeus-python |
Uh oh!
There was an error while loading.Please reload this page.