Remove input from all code cells in a notebook #503
-
Hi folks, I'm just exploring using jupyter book for writing a report (article) from a single notebook, and I am expecting a common scenario will be to want to remove inputs from all code cells, i.e., just show outputs. This can be achieved by adding the "remove-input" tag to all code cells, but that is likely to get tedious to do by hand. I also found this example script showing how to add tags to cells programmatically, which I could definitely adapt to achieve what I want. I'm just thinking it could be nice to add built-in capability to do this, e.g., a command line parameter like If we adopt jupyter book as our main technology for writing reports I expect I'll be teaching a few people how to use it, and would be nice not to have to also pass around a custom script to add the remove-input tags. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Heya, I'm part way through a bit of a rewrite of the myst-nb module (that handles this), and here I am looking to implement "cascading" configuration, e.g. prioritizing: CLI < _config.yml < notebook level metadata < cell level metadata |
Beta Was this translation helpful? Give feedback.
-
This is also tracked in jupyter-book/jupyter-book#666 In the meantime, you can make a sphinx extension that adds the desired tag to all cells. I use this approach here, combined with this. |
Beta Was this translation helpful? Give feedback.
Heya, I'm part way through a bit of a rewrite of the myst-nb module (that handles this), and here I am looking to implement "cascading" configuration, e.g. prioritizing: CLI < _config.yml < notebook level metadata < cell level metadata