From c28aab1124421d34bae799adec15446fe438e344 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Thu, 8 May 2025 14:38:11 +0200 Subject: [PATCH 01/10] configure `jupyterlite-sphinx`' `try_examples` feature --- doc/conf.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/conf.py b/doc/conf.py index d4328dbf1b0..dd1392d99fe 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -89,6 +89,7 @@ "sphinx_design", "sphinx_inline_tabs", "sphinx_remove_toctrees", + "jupyterlite_sphinx", ] @@ -187,6 +188,11 @@ "pd.NaT": "~pandas.NaT", } +# jupyterlite try_examples config +global_enable_try_examples = True +try_examples_global_button_text = "Try it in your browser!" +try_examples_global_warning_text = "Interactive examples are experimental and may not always work as expected." + # mermaid config mermaid_version = "10.9.1" From 774d6138f8f3bdb7df1bb6f74b76f1b0d7e0ed43 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Thu, 8 May 2025 14:39:07 +0200 Subject: [PATCH 02/10] set a minimum height --- doc/try_examples.json | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 doc/try_examples.json diff --git a/doc/try_examples.json b/doc/try_examples.json new file mode 100644 index 00000000000..47b9a700048 --- /dev/null +++ b/doc/try_examples.json @@ -0,0 +1,3 @@ +{ + "global_min_height": "400px" +} From a63ace9ececc38fec122acfa8336a1e41546e5f2 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Thu, 8 May 2025 16:30:20 +0200 Subject: [PATCH 03/10] [skip-ci] From 4c0a096aff9aa51fa6e83d7b74c5d5b666ae3b8d Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Thu, 8 May 2025 16:47:43 +0200 Subject: [PATCH 04/10] [skip-ci] From 438b597fe19ec985754458d385f1a2ee80e8699b Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Thu, 8 May 2025 16:48:45 +0200 Subject: [PATCH 05/10] bad merge [skip-ci] --- doc/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index 347c903302c..1691da30cc0 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -114,7 +114,6 @@ # AutoDoc configuration autosummary_generate = True autodoc_typehints = "none" -autodoc_type_aliases = napoleon_type_aliases # Keep both in sync # Napoleon configuration napoleon_google_docstring = False @@ -183,6 +182,7 @@ "pd.Index": "~pandas.Index", "pd.NaT": "~pandas.NaT", } +autodoc_type_aliases = napoleon_type_aliases # Keep both in sync # jupyterlite try_examples config global_enable_try_examples = True From 3dc3abe9bca78b5e06fe3cc8f160fca0c865a677 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Thu, 8 May 2025 17:01:17 +0200 Subject: [PATCH 06/10] add `jupyterlite-sphinx` to the env [skip-ci][skip-rtd] --- ci/requirements/doc.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/requirements/doc.yml b/ci/requirements/doc.yml index 0559f393bd0..da16f34adeb 100644 --- a/ci/requirements/doc.yml +++ b/ci/requirements/doc.yml @@ -18,6 +18,7 @@ dependencies: - iris - jupyter_client - jupyter_sphinx + - jupyterlite-sphinx - matplotlib-base - nbsphinx - ncdata From 807fd69e276d3e547dc8e49b58b7ad6c3131695f Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Thu, 8 May 2025 17:53:58 +0200 Subject: [PATCH 07/10] also install the pyodide kernel --- ci/requirements/doc.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/requirements/doc.yml b/ci/requirements/doc.yml index da16f34adeb..2f34ab8bf36 100644 --- a/ci/requirements/doc.yml +++ b/ci/requirements/doc.yml @@ -19,6 +19,7 @@ dependencies: - jupyter_client - jupyter_sphinx - jupyterlite-sphinx + - jupyterlite-pyodide-kernel - matplotlib-base - nbsphinx - ncdata From 31a6db6f2db0d2c5a52ebc3f915371fec77f009e Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Thu, 8 May 2025 23:59:55 +0200 Subject: [PATCH 08/10] ignore the `_contents` directory created by `jupyterlite-sphinx` --- doc/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index 1691da30cc0..f9c32140ed8 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -219,7 +219,7 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. -exclude_patterns = ["_build", "**.ipynb_checkpoints"] +exclude_patterns = ["_build", "**.ipynb_checkpoints", "_contents"] # The name of the Pygments (syntax highlighting) style to use. From 28afda4d3a6ecff0afe45b56c7e5b2cbabd441d3 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Fri, 9 May 2025 00:00:21 +0200 Subject: [PATCH 09/10] [skip-ci] From a4d12853adb49f7d9e891620ae29a3647ba133a2 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Fri, 9 May 2025 00:00:56 +0200 Subject: [PATCH 10/10] [skip-ci]