We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 963f6b2 commit 1215494Copy full SHA for 1215494
1 file changed
scripts/clean_notebooks.sh
@@ -0,0 +1,24 @@
1
+#!/bin/bash
2
+
3
+# Clean your notebooks!
4
5
+# Clear all the output from all cells
6
+jupyter-nbconvert --clear-output $@
7
8
+# Run the whole notebook in order from start to end
9
+## We don't run with --ClearMetadataPreprocessor.enabled=True
10
+## as this is used to tag cells where nbval should skip checking
11
+jupyter-nbconvert \
12
+ --execute \
13
+ --allow-errors \
14
+ --to notebook \
15
+ --inplace \
16
+ $@
17
18
+# Strip superfluous metadata
19
+## NB: may need more extra-keys, these are just the current offenders
20
+nbstripout \
21
+ --keep-output \
22
+ --keep-count \
23
+ --extra-keys='cell.metadata.editable cell.metadata.slideshow' \
24
0 commit comments