Merge branch 'main' into publish

This commit is contained in:
Tom van Woudenberg 2024-09-25 16:50:24 +02:00
commit 51ee5322ab
3 changed files with 20 additions and 21 deletions

View file

@ -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:

View file

@ -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": {

View file

@ -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.