From 2d2589db3cd121f9eb6da039ef2a8cd9e36dd696 Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Fri, 22 Mar 2024 11:26:17 +0100 Subject: [PATCH] Restructured live-code page --- book/_toc.yml | 16 +++++++++------- book/features/python_interactivity.md | 5 +++++ book/features/widgets.ipynb | 2 +- 3 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 book/features/python_interactivity.md diff --git a/book/_toc.yml b/book/_toc.yml index e3e1240..5d0ca6d 100644 --- a/book/_toc.yml +++ b/book/_toc.yml @@ -40,14 +40,16 @@ parts: - file: features/grasple.md - file: features/h5p.md - file: features/adding_basic_HTML_elements.md - - file: features/live_code.md + - file: features/python_interactivity.md sections: - - file: features/widgets.ipynb - - file: features/exercise_checking.ipynb - - file: features/jupyterlite/jupyterlite - sections: - - file: features/jupyterlite/configuration - - file: features/jupyterlite/including-jupyterlite + - file: features/live_code.md + sections: + - file: features/widgets.ipynb + - file: features/exercise_checking.ipynb + - file: features/jupyterlite/jupyterlite + sections: + - file: features/jupyterlite/configuration + - file: features/jupyterlite/including-jupyterlite - caption: Examples diff --git a/book/features/python_interactivity.md b/book/features/python_interactivity.md new file mode 100644 index 0000000..b63d8aa --- /dev/null +++ b/book/features/python_interactivity.md @@ -0,0 +1,5 @@ +# Python-enabled interactivity + +In general, there are two option to include python-enabled interactivity embedded in your book: + - Using our [own sphinx-thebe extension](live_code.md) which makes code cells in your `.ipynb` book pages editable and executable by the reader! Opposed to the original sphinx-thebe extensions, our extension runs python in the reader's browser and doesn't rely on an external webserver for the python kernel. We highly recommend this extension as it allows you to use the strength of combining text/figures and code of a jupyter book with interactivity! + - Using [JupyterLite](jupyterlite/jupyterlite.md) to create 'iframe-like' Ipython consoles / jupyterbook / jupyter lab environments in your book. As these 'iframes' are separate modules added to your page, the integration with the other content in your book is less flexible as with our sphinx-thebe extension. \ No newline at end of file diff --git a/book/features/widgets.ipynb b/book/features/widgets.ipynb index 361cb93..36bff96 100644 --- a/book/features/widgets.ipynb +++ b/book/features/widgets.ipynb @@ -4,7 +4,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Widgets\n", + "# Ipywidgets\n", "\n", "If you publish widgets in a jupyter book they might (depending on your implementation) require an active python kernel for the output to be interactive. Using the [thebe-integration](live_code.md), this is possible. Note: You can circumvent the use of a kernel by using packages which don't need such a kernel, for example the [non-kernel-based widgets using Plotly](interactive_element).\n", "\n",