From 7170d2607e38d0b400878aeb66460b8be269a5f6 Mon Sep 17 00:00:00 2001 From: Caspar Jungbacker <74240267+CasparJungbacker@users.noreply.github.com> Date: Sun, 7 May 2023 15:19:27 +0200 Subject: [PATCH] Add Jupyterlite REPL example --- book/_config.yml | 3 +++ book/_toc.yml | 3 ++- book/cookbook/jupyterlite.md | 9 +++++++++ jupyterlite-config.json | 8 ++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 book/cookbook/jupyterlite.md create mode 100644 jupyterlite-config.json diff --git a/book/_config.yml b/book/_config.yml index abf141e..4273941 100644 --- a/book/_config.yml +++ b/book/_config.yml @@ -8,3 +8,6 @@ execute: sphinx: extra_extensions: - sphinx_inline_tabs + - jupyterlite_sphinx + config: + jupyterlite_config: jupyterlite-config.json diff --git a/book/_toc.yml b/book/_toc.yml index bf5c061..110d88c 100644 --- a/book/_toc.yml +++ b/book/_toc.yml @@ -9,4 +9,5 @@ parts: - file: installation-and-setup/jupyter-book-setup - caption: Cookbook chapters: - - file: cookbook/recipes.md \ No newline at end of file + - file: cookbook/recipes.md + - file: cookbook/jupyterlite.md \ No newline at end of file diff --git a/book/cookbook/jupyterlite.md b/book/cookbook/jupyterlite.md new file mode 100644 index 0000000..f16beb3 --- /dev/null +++ b/book/cookbook/jupyterlite.md @@ -0,0 +1,9 @@ +# Interactive elements with Jupyterlite-Sphinx + +```{eval-rst} +.. replite:: + :kernel: python + :height: 600px + + print("test") +``` \ No newline at end of file diff --git a/jupyterlite-config.json b/jupyterlite-config.json new file mode 100644 index 0000000..7fbf1bb --- /dev/null +++ b/jupyterlite-config.json @@ -0,0 +1,8 @@ +{ + "LiteBuildConfig": { + "federated_extensions": [ + "https://github.com/jupyterlite/pyodide-kernel/releases/download/v0.0.5/jupyterlite_pyodide_kernel-0.0.5-py3-none-any.whl" + ], + "ignore_sys_prefix": true + } +} \ No newline at end of file