diff --git a/book/features/exercise_checking.ipynb b/book/features/exercise_checking.ipynb index 83445c7..f77efc9 100644 --- a/book/features/exercise_checking.ipynb +++ b/book/features/exercise_checking.ipynb @@ -10,8 +10,6 @@ "\n", "A function has been made to check the value of a variable. As input values it takes the variable name, the expected value (correct answer) and how these values should be compared. You need to add this function to each page, including the imports, and add the `thebe-remove-input-init` tag to the cell.\n", "```python\n", - "import micropip\n", - "await micropip.install(\"ipywidgets\")\n", "import ipywidgets as widgets\n", "from IPython.display import display\n", "import operator\n", @@ -46,8 +44,6 @@ }, "outputs": [], "source": [ - "import micropip\n", - "await micropip.install(\"ipywidgets\")\n", "import ipywidgets as widgets\n", "from IPython.display import display\n", "import operator\n", diff --git a/book/features/live_code.md b/book/features/live_code.md index 505356f..3ae3085 100644 --- a/book/features/live_code.md +++ b/book/features/live_code.md @@ -8,25 +8,25 @@ To set up the Python live coding you need to add our [own sphinx-thebe extension For `requirements.txt` add the following lines: ``` --extra-index-url https://gitlab.tudelft.nl/api/v4/projects/11239/packages/pypi/simple -sphinx-thebe == 0.2.1000 +sphinx-thebe ~= 0.9.9 ``` This will download the correct version of the sphinx extension when the book is build on the server (which loads the required packages from `requirements.txt`) Afterwards, this sphinx extension needs to be enabled in your book. This can be done by adding the following lines to `_config.yml`: ``` -launch_buttons: - thebe: true - sphinx: html_js_files: - https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js thebe_config: use_thebe_lite: true exclude_patterns: ["**/_*.yml", "**/*.md", "**/*.ipynb"] + html_theme_options: + launch_buttons: + thebe: true ``` -By `launch_buttons` you initiate the {fa}`rocket` --> {guilabel}`Live Code` on the top right corner of every page generated from a `.ipynb` file. The `html_js_files` link calls for some required javascript files. `use_thebe_lite` makes sure you initiate our adapted sphinx thebe extensions. The `exclude_patterns` makes sure you import all files so that they can be accessed from your code, except for the files matching the patterns shown. +The `html_js_files` link calls for some required javascript files. `use_thebe_lite` makes sure you initiate our adapted sphinx thebe extensions. The `exclude_patterns` makes sure you import all files so that they can be accessed from your code, except for the files matching the patterns shown. By `launch_buttons` you initiate the {fa}`rocket` --> {guilabel}`Live Code` on the top right corner of every page generated from a `.ipynb` file. As opposed to the jupyter book documentation, this button has to be specified from within `sphinx: html_theme_options` where you might also specify other buttons as well (ie. the [code repository button](https://jupyterbook.org/en/stable/basics/repository.html)). ## Instructions: local build @@ -44,5 +44,4 @@ With the extended functionality of live code, additional cell tags have been dev - `disable-execution-page` disables the ability to execute the entire page. This might be useful if you use python code for creating a page, but the code is not part of the actual content of the book. - `auto-execute-page` automatically starts the thebe live coding functionality whenever the page is opened. This is particularly useful if you're using widgets on a page. - `thebe-init` directly starts running this cell as soon as the thebe live coding functionality starts. -- `thebe-remove-input-init`, as `thebe-init`, starts the cell directly as soon as the thebe live coding functionality starts. However, the input is not shown to the students (in static and interactive mode). The original `remove-input` tag will not work as it deletes the entire cell, so it can never be executed. - +- `thebe-remove-input-init`, as `thebe-init`, starts the cell directly as soon as the thebe live coding functionality starts. However, the input is not shown to the students (in static and interactive mode). The original `remove-input` tag will not work as it deletes the entire cell, so it can never be executed. \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index a3dc6e5..ad037b3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ jupyterlite-xeus-python jupyterlite-sphinx --extra-index-url https://gitlab.tudelft.nl/api/v4/projects/11239/packages/pypi/simple -sphinx-thebe == 0.2.1000 +sphinx-thebe ~= 0.9.9 --extra-index-url https://gitlab.tudelft.nl/api/v4/projects/17983/packages/pypi/simple -jupyterbook_patches == 0.1.2 -download_link_replacer @ git+https://gitlab.tudelft.nl/mude/sphinx-download-link-replacer@dlr-0.1.2 +jupyterbook_patches ~= 0.1.4 +download_link_replacer @ git+https://gitlab.tudelft.nl/mude/sphinx-download-link-replacer