From 68e28e753135cc6c11dd44c4e7f6d470756b1513 Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Wed, 25 Sep 2024 16:45:22 +0200 Subject: [PATCH] removed jupyterlite --- book/_toc.yml | 12 +++--------- book/features/live_code.ipynb | 19 +++++++++++++++++-- book/features/python_interactivity.md | 10 ---------- 3 files changed, 20 insertions(+), 21 deletions(-) delete mode 100644 book/features/python_interactivity.md diff --git a/book/_toc.yml b/book/_toc.yml index f5e0fba..1c03d88 100644 --- a/book/_toc.yml +++ b/book/_toc.yml @@ -55,16 +55,10 @@ parts: sections: - file: features/adding_HTML_elements.md - file: features/creating_basic_HTML_elements.md - - file: features/python_interactivity.md + - file: features/live_code sections: - - file: features/live_code - 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/widgets.ipynb + - file: features/exercise_checking.ipynb - caption: Examples chapters: diff --git a/book/features/live_code.ipynb b/book/features/live_code.ipynb index f479f66..8401ca3 100644 --- a/book/features/live_code.ipynb +++ b/book/features/live_code.ipynb @@ -4,9 +4,16 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Sphinx-thebe\n", + "# Run Python inside your book with Sphinx-thebe\n", "\n", - "Our book has been enable to run Python code live in the browser (thanks Max!). This page contains some installation instructions and the other sections show how to use this functionality to create interactive figures and feedback on code\n", + "```{admonition} User types\n", + ":class: tip\n", + "This section is useful for user type 5-6.\n", + "```\n", + "\n", + "Our book has been enable to run Python code live in the browser (thanks Max!). This extension 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!\n", + "\n", + "This page contains some installation instructions and the other sections show how to use this functionality to create interactive figures and feedback on code\n", "\n", "To see this happening, click {fa}`rocket` --> {guilabel}`Live Code` on the top right corner of this page" ] @@ -123,6 +130,14 @@ "%pip install package_name\n", "```\n" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Alternative with JupyterLite (less well integrated)\n", + "Another option to use python in your browser is to use JupyterLite. However, this doesn't give a similar seamless interface. You could 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. Furthermore, the best way to use a JupyterLite session would be a separate repo with the jupyter lab interface anyway, so you get the full browser experience. Alternatively, the ipython REPL better can be usefull, as shown here: https://teachbooks.github.io/learn-python/main/Python_Toolbox.html." + ] } ], "metadata": { diff --git a/book/features/python_interactivity.md b/book/features/python_interactivity.md deleted file mode 100644 index adfc5a6..0000000 --- a/book/features/python_interactivity.md +++ /dev/null @@ -1,10 +0,0 @@ -# Python-enabled interactivity - -```{admonition} User types -:class: tip -This section is useful for user type 5-6. -``` - -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