mirror of
https://github.com/TeachBooks/manual.git
synced 2026-11-12 22:35:51 +00:00
Added sphinx grasple as submodule
This commit is contained in:
parent
14b84539ab
commit
94ed0027cd
6 changed files with 7 additions and 71 deletions
3
.gitmodules
vendored
3
.gitmodules
vendored
|
|
@ -25,3 +25,6 @@
|
|||
[submodule "book/external/Download-Link-Replacer"]
|
||||
path = book/external/Download-Link-Replacer
|
||||
url = https://github.com/TeachBooks/Download-Link-Replacer.git
|
||||
[submodule "book/external/Sphinx-Grasple-public"]
|
||||
path = book/external/Sphinx-Grasple-public
|
||||
url = https://github.com/TeachBooks/Sphinx-Grasple-public.git
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ sphinx:
|
|||
- sphinx.ext.imgconverter
|
||||
- download_link_replacer
|
||||
- jupyterbook_patches
|
||||
- teachbooks_sphinx_grasple
|
||||
config:
|
||||
html_js_files:
|
||||
- https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ parts:
|
|||
- file: external/JupyterBook-Patches/README.md
|
||||
- file: features/interactive_element.ipynb
|
||||
sections:
|
||||
- file: features/grasple.md
|
||||
- file: external/Sphinx-Grasple-public/README.md
|
||||
- file: features/h5p.md
|
||||
- file: features/HTML_javascript.md
|
||||
sections:
|
||||
|
|
|
|||
1
book/external/Sphinx-Grasple-public
vendored
Submodule
1
book/external/Sphinx-Grasple-public
vendored
Submodule
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 6e7b6b681a2167f46fef9c02ae3feeaa12e6506a
|
||||
|
|
@ -1,70 +0,0 @@
|
|||
# Grasple questions
|
||||
|
||||
```{admonition} User types
|
||||
:class: tip
|
||||
This section is useful for user type 3-5.
|
||||
```
|
||||
|
||||
[Grasple](https://app.grasple.com/) gives you an embed code for each exercise which looks like this, which can be added cirectly to your markdown-file.
|
||||
```html
|
||||
<iframe height="560" src="https://embed.grasple.com/exercises/767782d5-023a-4b49-a1f3-874fca626c8e?id=79907" title="Grasple Exercise 79907" width="100%" allow="clipboard-read; clipboard-write"></iframe>
|
||||
```
|
||||
|
||||
The embed link is created for an exercise under 'More'- 'Embed Exercise'
|
||||
|
||||
This iframe can be embedded into your Jupyter book.
|
||||
|
||||
```{admonition} Note
|
||||
:class: tip
|
||||
This feature doesn't display in a book that is viewed locally via your browser, unless you set up a local webserver (instructions [here](setup-local-server)).
|
||||
```
|
||||
The code shown above gives:
|
||||
<iframe height="560" src="https://embed.grasple.com/exercises/767782d5-023a-4b49-a1f3-874fca626c8e?id=79907" title="Grasple Exercise 79907" width="100%" allow="clipboard-read; clipboard-write"></iframe>
|
||||
|
||||
More information on Grasple and the support of TU Delft can be found on: [Teaching Support - Educational Tools - Grasple](https://www.tudelft.nl/en/teaching-support/educational-tools/grasple)
|
||||
|
||||
## Replace iframe by QR code for printed version
|
||||
Dani Balague Guardia created an [extension](https://github.com/dbalague/sphinx-grasple) which allows you to easily add Grasple question with some formatting and, more importantly, the creation of QR codes in the PDF version of the page. This leads to the source link of the iframe.
|
||||
|
||||
This extension can be installed by running
|
||||
|
||||
`pip install git+https://github.com/dbalague/sphinx-grasple`
|
||||
|
||||
The grasple exercise as shown above can now be added as follows in your markdown file:
|
||||
```markdown
|
||||
::::{grasple}
|
||||
:url: https://embed.grasple.com/exercises/767782d5-023a-4b49-a1f3-874fca626c8e?id=79907
|
||||
:label: grasple_exercise_1
|
||||
:dropdown:
|
||||
:description: Example of exercise which goes along
|
||||
|
||||
::::
|
||||
```
|
||||
|
||||
This leads to the following html in the Jupyter book. Remark: again, the iframe doesn't locally in VScode or in the build file, only on the hosted version.
|
||||
<div class="grasple admonition" id="grasple_exercise_1">
|
||||
|
||||
<p class="admonition-title"><span class="caption-number">Grasple Exercise 1 </span></p>
|
||||
<div class="section" id="admonition-content">
|
||||
<div class="side-by-side docutils container">
|
||||
<div class="description-container docutils container">
|
||||
<p></p><p>Example of exercise which goes along</p>
|
||||
<p></p>
|
||||
</div>
|
||||
</div>
|
||||
<details class="dropdown"><summary>Show/Hide Content</summary><iframe src="https://embed.grasple.com/exercises/767782d5-023a-4b49-a1f3-874fca626c8e?id=79907" width="100%" height="400px"></iframe></details></div>
|
||||
</div>
|
||||
|
||||
In the PDF this leads to:
|
||||
```{figure} ../images/Grasple_pdf.png
|
||||
```
|
||||
|
||||
|
||||
The extension requires an extension of the `config.yml` file:
|
||||
```markdown
|
||||
extra_extensions:
|
||||
- sphinx_grasple
|
||||
- sphinx.ext.imgconverter
|
||||
```
|
||||
|
||||
The extension should be installed both locally and on the server.
|
||||
|
|
@ -4,6 +4,7 @@ sphinx-inline-tabs
|
|||
jupyterlite-sphinx
|
||||
jupyterbook_patches
|
||||
download_link_replacer
|
||||
teachbooks-sphinx-grasple
|
||||
|
||||
|
||||
--extra-index-url https://gitlab.tudelft.nl/api/v4/projects/11239/packages/pypi/simple
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue