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
Add option to hide code cell in Jupyter notebooks (#183)
* Initial commit adding option to hide code cells when rendering Jupyter notebooks
* add types-six to requirements.txt
* update types
* skip parameter type check
* add types-click to requirements.txt
* Add types-Flask to requirements.txt
* rename noinput
* add feature to hide input cells tagged with 'remove_input'
* rename no_input to hide_all_input; rename no_tag_input to hide_tagged_input
* Update changelog for hide Jupyter code cell API
* update parameters to match click
* fix hide tagged input not working for static mode
* hide_all_input will take precedence if both hide_all_input and hide_tagged_input are selected
* Revert "hide_all_input will take precedence if both hide_all_input and hide_tagged_input are selected"
This reverts commit 8e7e687.
* hide_all_input will take precedence when both hide_all_input and hide_tagged_input are selected
* update manifest creation so hide input options don't overwrite one another
* update defaults
* add jupyter manifest handling without changing default manifest format
* update defaults
* add Python 2 compatibility for hide cell feature
* Update README with Hide Jupyter Notebook Input Code Cells
* move version checking
* update readme wrt hide input cell Jupyter dependencies
* update TagRemovePreprocessor command for Python 2
* update TagRemovePreprocessor for Python 2
* update TagRemovePreprocessor to remove quotes for jupyter cli parsing
Copy file name to clipboardExpand all lines: CHANGELOG.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file.
4
4
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
7
+
7
8
## [1.5.4] - TBD
8
9
9
10
### Added
@@ -15,6 +16,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
15
16
rsconnect-python does not inspect the file contents to identify the object name, which must be
16
17
one of the default names that Connect expects (`app`, `application`, `create_app`, or `make_app`).
17
18
19
+
- Ability to hide code cells when rendering Jupyter notebooks.
20
+
21
+
After setting up Connect and rsconnect-python, the user can render a Jupyter notebook without its corresponding code cells by passing the ' hide-all-input' flag through the rsconnect cli:
22
+
23
+
```
24
+
rsconnect deploy notebook \
25
+
-n server \
26
+
-k APIKey \
27
+
--hide-all-input \
28
+
hello_world.ipynb
29
+
```
30
+
31
+
To selectively hide the input of cells, the user can add a tag call 'hide_input' to the cell, then pass the ' hide-tagged-input' flag through the rsconnect cli:
Copy file name to clipboardExpand all lines: README.md
+32Lines changed: 32 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -513,3 +513,35 @@ directory specified above.
513
513
<div style="display:none">
514
514
Generated from <code>rsconnect-python {{ rsconnect_python.version }}</code>
515
515
</div>
516
+
517
+
### Hide Jupyter Notebook Input Code Cells
518
+
519
+
The user can render a Jupyter notebook without its corresponding input code cells by passing the '--hide-all-input' flag through the cli:
520
+
521
+
```
522
+
rsconnect deploy notebook \
523
+
--server https://connect.example.org:3939 \
524
+
--api-key my-api-key \
525
+
--hide-all-input \
526
+
my-notebook.ipynb
527
+
```
528
+
529
+
To selectively hide input cells in a Jupyter notebook, the user needs to follow a two step process:
530
+
1. tag cells with the 'hide_input' tag,
531
+
2. then pass the ' --hide-tagged-input' flag through the cli:
532
+
533
+
```
534
+
rsconnect deploy notebook \
535
+
--server https://connect.example.org:3939 \
536
+
--api-key my-api-key \
537
+
--hide-tagged-input \
538
+
my-notebook.ipynb
539
+
```
540
+
541
+
By default, rsconnect-python does not install Jupyter notebook related depenencies. These dependencies are installed via rsconnect-jupyter. When the user is using the hide input features in rsconnect-python by itself without rsconnect-jupyter, he/she needs to install the following package depenecies:
0 commit comments