@@ -13,78 +13,55 @@ language_info:
1313 pygments_lexer : ipython3
1414---
1515
16- # hide-input
16+ # remove-in/output
1717
18- +++
18+ these 2 tags ( ` remove-input ` and ` remove-output ` ) are effective *** on code cells only ***
1919
20- this may require some more checking but IIRC the ` jupyterlab-courselevels ` may be required for this to work properly
20+ the feature is activated through the code cell's ` metadata.tags ` that contain ` remove-input ` or remove-output`
2121
22- +++
22+ ## textual input
2323
24- ## code cells
25-
26- +++
27-
28- ```` {caution}
29- the next code cells are marked as `metadata.tags` contains `hide-input`
30-
31- on a historical note: in nbclassic this used to be marked with `metadata.hide_input=true`
32- ````
33-
34- +++
35-
36- ```` {note}
37-
38- * thanks to (1) the jb HTML output will come as a collapsible
39- * thanks to the `jupyterlab-courselevels` extension, with (1) the code cell input should be hidden in jupyterlab (and hopefully nb7 as well)
40- * because of (2) the cell input will not show under nbclassic
41- this requires the jupyter contrib extensions installed, and the hide-input extension enabled
42- ````
43-
44- +++
45-
46- ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 2 hide-input cells below
24+ here's the textual input for the first cell below
4725
26+ ```` text
4827```{code-cell} ipython3
4928:tags: [remove-input]
50-
51- # this text should be hidden
52- print("should show the output but not the code")
29+ print("with remove-input we show the output but not the code")
5330```
31+ ````
32+
33+ ## ` remove-input `
34+
35+ ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 1 remove-input code cell below
5436
5537``` {code-cell} ipython3
5638:tags: [remove-input]
57-
58- # this text should be hidden
59- print('and another hide-input cell')
39+ print("with remove-input we show the output but not the code")
6040```
6141
62- ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ hide-input cells above
63-
64- +++
42+ ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ hide-input cell above
6543
66- ## 2 visible cells, one text and one code
44+ ## ` remove-output `
6745
68- +++
69-
70- with one markdown cell (this very one) and one code cell
46+ ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 1 remove-output code cell below
7147
7248``` {code-cell} ipython3
73- # code (visible)
74- print("hello ")
49+ :tags: [remove-output]
50+ print("this time we see the code and not the output ")
7551```
7652
77- ## same with hide-input
78-
79- below we repeat these 2 cells, with hide-input set
53+ ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ remove-output cell above
8054
81- +++ {"tags": [ " remove-input" ] }
55+ ## ` remove-cell `
8256
83- a (hidden-input) markdown cell wont show up at all
57+ ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 1 remove-cell code cell below
8458
8559``` {code-cell} ipython3
86- :tags: [remove-input ]
60+ :tags: [remove-cell ]
8761
88- # code (hidden-input) will just produce an output, but won't show up
89- print("hello ")
62+ # this time we see nothing
63+ print("should show the code but not the output ")
9064```
65+
66+ ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ remove-cell cell above
67+
0 commit comments