From a33b74df034657b99aa8ab7575c7a3f32500bddc Mon Sep 17 00:00:00 2001 From: Laryssa Abdala Date: Wed, 27 Jul 2022 22:45:54 -0400 Subject: [PATCH 1/4] feat(jupyterlite-sphinx): Add extension for embedding JupyterLite in docs --- docs/RTDContents/App/app.md | 4 ++++ docs/conf.py | 8 ++++---- docs/requirements.txt | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/RTDContents/App/app.md b/docs/RTDContents/App/app.md index 8d493ed..2fcfa83 100644 --- a/docs/RTDContents/App/app.md +++ b/docs/RTDContents/App/app.md @@ -1,5 +1,9 @@ # App +```{jupyterlite} + :width: 100% + :height: 600px +``` ## JupyterLite diff --git a/docs/conf.py b/docs/conf.py index 85f2e3e..2af7eca 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -43,9 +43,9 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ -# 'jupyterlite_sphinx', - "myst_parser", + "myst_parser", 'sphinx.ext.intersphinx', + 'jupyterlite_sphinx', ] # 'sphinx.ext.viewcode', # 'sphinx.ext.githubpages', @@ -58,8 +58,7 @@ #} # JupyterLite content -jupyterlite_contents=['App/test.ipynb'] -jupyterlite_dir = "." +jupyterlite_bind_ipynb_suffix = False # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -128,6 +127,7 @@ # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static', 'jupyterlite/_output' ] + def jupyterlite_build(app: Sphinx, error): here = Path(__file__).parent.resolve() jupyterlite_config = here / "jupyterlite" / "jupyterlite_config.json" diff --git a/docs/requirements.txt b/docs/requirements.txt index 969dbd1..3f9bc88 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -3,4 +3,5 @@ pygments==2.11.2 myst-parser==0.15.2 jupyterlite[all] pydata-sphinx-theme==0.9.0 +jupyterlite-sphinx==0.7.0 From 097a57f865d1e155c427fad82887040c5772f852 Mon Sep 17 00:00:00 2001 From: Laryssa Abdala Date: Tue, 9 Aug 2022 16:28:29 -0400 Subject: [PATCH 2/4] This is a test with iframe --- docs/RTDContents/App/app.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/RTDContents/App/app.md b/docs/RTDContents/App/app.md index 2fcfa83..4d7e9fd 100644 --- a/docs/RTDContents/App/app.md +++ b/docs/RTDContents/App/app.md @@ -5,6 +5,9 @@ :height: 600px ``` + + + ## JupyterLite From 8ec4fd4a2ca5a3492bcdd250b04499efce15dd70 Mon Sep 17 00:00:00 2001 From: Laryssa Abdala Date: Tue, 9 Aug 2022 16:51:52 -0400 Subject: [PATCH 3/4] fix(custom-css): Remove custom.css from conf.py This removed the MIME error, which is not the main problem for not running itkwidgets. --- docs/conf.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 2af7eca..26a07a9 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -118,10 +118,6 @@ },] } -#CSS custom -html_css_files = [ - 'css/custom.css', -] # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, From 96f3cc173234cfb4944c47ff1fb9d16723c4bbce Mon Sep 17 00:00:00 2001 From: Laryssa Abdala Date: Tue, 9 Aug 2022 17:44:22 -0400 Subject: [PATCH 4/4] Change iframe src to point to relative repo --- docs/RTDContents/App/app.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/docs/RTDContents/App/app.md b/docs/RTDContents/App/app.md index 4d7e9fd..21529aa 100644 --- a/docs/RTDContents/App/app.md +++ b/docs/RTDContents/App/app.md @@ -1,11 +1,7 @@ # App -```{jupyterlite} - :width: 100% - :height: 600px -``` - + ## JupyterLite