You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For Jupyter version 4 or 5, use the master branch of the repository.
37
+
Most nbextensions have been updated to work with both Jupyter 4.x and 5.x, but occasionally things get missed, or the Jupyter API changes in a minor version update, so if anything doesn't work as you'd expect/hope, please do check the issues, or open a new one as necessary!
41
38
42
-
There are different branches of the notebook extensions in this repository.
43
-
Please make sure you use the branch corresponding to your IPython/Jupyter version.
39
+
This repo is pretty much all in the main master branch, although there remain vestigial branches for IPython notebook versions 2.x and 3.x.
44
40
45
41
46
42
Documentation
@@ -49,20 +45,20 @@ Documentation
49
45
Documentation for all maintained extensions can be found at
Most nbextensions here should work fine with jupyterhub (because jupyterhub spawns regular notebook servers for each individual user), but won't work with jupyterlab (because the jupyterlab javascript framework is different to notebook's, and still rapidly changing under active development).
227
213
228
214
See also [installing Jupyter](https://jupyter.readthedocs.io/en/latest/install.html)
229
215
230
216
231
217
Notebook extension structure
232
218
============================
233
219
234
-
The nbextensions are stored in the repository each as a separate subdirectory of
235
-
`src/jupyter_contrib_nbextensions/nbextensions`.
220
+
Most of the nbextensions are stored in the repository each as a separate subdirectory of
Each notebook extension typically has its own directory named after the extension, containing:
238
224
@@ -241,12 +227,16 @@ Each notebook extension typically has its own directory named after the extensio
241
227
*`thisextension/thisextension.css` - optional CSS file, which may be loaded by the javascript
242
228
*`thisextension/README.md` - readme file describing the nbextension in markdown format
243
229
230
+
A few (jupyter_highlight_selected_word, jupyter_latex_envs), exist as separate packages on pypi, which are included as dependencies of this package.
231
+
244
232
For further details, see [the documentation at jupyter-contrib-nbextensions.readthedocs.io](http://jupyter-contrib-nbextensions.readthedocs.io/en/latest/internals.html).
245
233
234
+
246
235
Contributing
247
236
============
248
237
249
-
To learn how to setup a development enivornment and contribution guidelines, see [CONTRIBUTING.md](./CONTRIBUTING.md).
238
+
To learn how to setup a development environment and for contribution guidelines, see [CONTRIBUTING.md](./CONTRIBUTING.md).
The `jupyter contrib nbextensions` command also offers a `migrate` subcommand,
146
-
which will
147
-
148
-
* uninstall the old repository version's files, config and python package
149
-
* adapt all `require` paths which have changed. E.g. if you had the
150
-
collapsible headings nbextension enabled with its old require path of
151
-
`usability/collapsible_headings/main`, the `migrate` command will alter
152
-
this to match the new require path of `collapsible_headings/main`.
142
+
4\. More complex setups
143
+
-----------------------
153
144
145
+
Most nbextensions here should work fine with jupyterhub (because jupyterhub spawns regular notebook servers for each individual user), but won't work with jupyterlab (because the jupyterlab javascript framework is different to notebook's, and still rapidly changing under active development).
154
146
For complex or customized installation scenarios, please look at the
155
147
documentation for installing notebook extensions, server extensions, nbconvert
156
148
pre/postprocessors and templates on the [Jupyter homepage](https://jupyter.org).
Copy file name to clipboardExpand all lines: src/jupyter_contrib_nbextensions/nbextensions/exercise/readme.md
+20-8Lines changed: 20 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ enabled.
10
10
The example below demonstrates some of the features of the exercise extensions.
11
11
12
12
- First, an solution or "details" cell is created by (a) selecting two cells with the rubberband and (b) clicking on the menu-button [exercise extension]
13
-
- Second, the two next cells are selected using the keyboard shortcut Shift-J and a solution is created using the shortcut Alt-D [exercise2 extension]
13
+
- Second, the two next cells are selected using a keyboard shortcut, and a solution is created using the shortcut Alt-D [exercise2 extension]
14
14
- Third, the two solutions are expanded by clicking on the corresponding widgets
15
15
- Fourth, the solutions are removed by selecting them and clicking on the buttons in the toolbar.
16
16
@@ -23,18 +23,30 @@ The extensions provide
23
23
- a menubar button
24
24
- a cell widget -- A plus/minus button in `exercise` and a sliding checkbox in `exercise2`.
25
25
26
-
The menubar button is devoted to the creation or removing of the solution. The solution consists in several consecutive cells that can be selected either by multicell selection (*Shift-J* (select next) or *Shift-K* (select previous) keyboard shortcuts --
27
-
*Shift-up* and *Shift-down* will probably work in a near future) or using the [rubberband extension](https://github.com/ipython-contrib/jupyter_contrib_nbextensions/wiki/Rubberband).
26
+
The menubar button is devoted to the creation or removing of the solution. The solution consists in several consecutive cells that can be selected by the usual notebook multicell selection methods (e.g. *Shift-down* (select next) or *Shift-up* (select previous) keyboard shortcuts, or using the rubberband extension.
27
+
28
+
29
+
### Creating a solution
28
30
29
-
**Creating a solution **
30
31
Several cells being selected, pressing the menubar button adds a `cell widget` and hides the cells excepted the first one which serves as a heading cell. *Do not forget to keep the Shift key pressed down while clicking on the menu button
31
32
(otherwise selected cells will be lost)*. It is also possible to use a keyboard shortcut for creating the solution from selected cells: Alt-S for exercise extension and Alt-D for exercise2.
32
33
33
-
**Removing a solution** If a solution heading (first) cell is selected, then clicking the menu bar button removes this solution and its solutions cells are shown. Using the keyboard shortcut has the same effect.
34
34
35
-
**Showing/hiding solution** At creation of the solution, the solution cells are hidden. Clicking the `cell widget` toggles the hidden/shown state of the solution.
35
+
### Removing a solution
36
+
37
+
If a solution heading (first) cell is selected, then clicking the menu bar button removes this solution and its solutions cells are shown. Using the keyboard shortcut has the same effect.
38
+
39
+
40
+
### Showing/hiding solution
41
+
42
+
At creation of the solution, the solution cells are hidden. Clicking the `cell widget` toggles the hidden/shown state of the solution.
43
+
44
+
45
+
### Persistence
46
+
47
+
The state of solutions, hidden or shown, is preserved and automatically restored at startup and on reload.
36
48
37
-
**Persistence** The state of solutions, hidden or shown, is preserved and automatically restored at startup and on reload.
38
49
39
-
**Internals** exercise and exercise2 add respectively a solution and solution2 metadata to solution cells, with for value the current state hidden/shown of the solution. For exercise, a div with the plus/minus character is prepended to the solution heading cell. For exercise2, a flex-wrap style is added to the solution heading cell and a checkbox widget, with some css styling, is appended to the cell.
50
+
### Internals
40
51
52
+
exercise and exercise2 add respectively a solution and solution2 metadata to solution cells, with for value the current state hidden/shown of the solution. For exercise, a div with the plus/minus character is prepended to the solution heading cell. For exercise2, a flex-wrap style is added to the solution heading cell and a checkbox widget, with some css styling, is appended to the cell. A solution[.2]_first metadada is also added to enable an easy detection of the first cell in an "exercise" and then allow several consecutive exercises.
These are two extensions for Jupyter, for hiding/showing solutions cells.
4
5
They use the same approach and codebase and differ only by the type of
@@ -9,31 +10,43 @@ enabled.
9
10
The example below demonstrates some of the features of the exercise extensions.
10
11
11
12
- First, an solution or "details" cell is created by (a) selecting two cells with the rubberband and (b) clicking on the menu-button [exercise extension]
12
-
- Second, the two next cells are selected using the keyboard shortcut Shift-J and a solution is created using the shortcut Alt-D [exercise2 extension]
13
+
- Second, the two next cells are selected using a keyboard shortcut, and a solution is created using the shortcut Alt-D [exercise2 extension]
13
14
- Third, the two solutions are expanded by clicking on the corresponding widgets
14
15
- Fourth, the solutions are removed by selecting them and clicking on the buttons in the toolbar.
15
16
16
17

17
18
18
19
19
-
## The extensions provide
20
+
The extensions provide
21
+
----------------------
20
22
21
23
- a menubar button
22
24
- a cell widget -- A plus/minus button in `exercise` and a sliding checkbox in `exercise2`.
23
25
24
-
The menubar button is devoted to the creation or removing of the solution. The solution consists in several consecutive cells that can be selected either by multicell selection (*Shift-J* (select next) or *Shift-K* (select previous) keyboard shortcuts --
25
-
*Shift-up* and *Shift-down* will probably work in a near future) or using the
The menubar button is devoted to the creation or removing of the solution. The solution consists in several consecutive cells that can be selected by the usual notebook multicell selection methods (e.g. *Shift-down* (select next) or *Shift-up* (select previous) keyboard shortcuts, or using the rubberband extension.
27
+
28
+
29
+
### Creating a solution
27
30
28
-
**Creating a solution **
29
31
Several cells being selected, pressing the menubar button adds a `cell widget` and hides the cells excepted the first one which serves as a heading cell. *Do not forget to keep the Shift key pressed down while clicking on the menu button
30
32
(otherwise selected cells will be lost)*. It is also possible to use a keyboard shortcut for creating the solution from selected cells: Alt-S for exercise extension and Alt-D for exercise2.
31
33
32
-
**Removing a solution** If a solution heading (first) cell is selected, then clicking the menu bar button removes this solution and its solutions cells are shown. Using the keyboard shortcut has the same effect.
33
34
34
-
**Showing/hiding solution** At creation of the solution, the solution cells are hidden. Clicking the `cell widget` toggles the hidden/shown state of the solution.
35
+
### Removing a solution
36
+
37
+
If a solution heading (first) cell is selected, then clicking the menu bar button removes this solution and its solutions cells are shown. Using the keyboard shortcut has the same effect.
38
+
39
+
40
+
### Showing/hiding solution
41
+
42
+
At creation of the solution, the solution cells are hidden. Clicking the `cell widget` toggles the hidden/shown state of the solution.
43
+
44
+
45
+
### Persistence
46
+
47
+
The state of solutions, hidden or shown, is preserved and automatically restored at startup and on reload.
35
48
36
-
**Persistence** The state of solutions, hidden or shown, is preserved and automatically restored at startup and on reload.
37
49
38
-
**Internals** exercise and exercise2 add respectively a solution and solution2 metadata to solution cells, with for value the current state hidden/shown of the solution. For exercise, a div with the plus/minus character is prepended to the solution heading cell. For exercise2, a flex-wrap style is added to the solution heading cell and a checkbox widget, with some css styling, is appended to the cell. A solution[.2]_first metadada is also added to enable an easy detection of the first cell in an "exercise" and then allow several consecutive exercises.
50
+
### Internals
39
51
52
+
exercise and exercise2 add respectively a solution and solution2 metadata to solution cells, with for value the current state hidden/shown of the solution. For exercise, a div with the plus/minus character is prepended to the solution heading cell. For exercise2, a flex-wrap style is added to the solution heading cell and a checkbox widget, with some css styling, is appended to the cell. A solution[.2]_first metadada is also added to enable an easy detection of the first cell in an "exercise" and then allow several consecutive exercises.
0 commit comments