-
Notifications
You must be signed in to change notification settings - Fork 139
Add option to hide cell input of a single cell using its metadata. #837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Thanks for this PR! Can you please address the comments I made in #15? |
I've reviewd #15 and some of its references and I think that this PR is the least disruptive from all other propositions, as it utilizes the existing metadata keyword My specific use case is for creating documentation using If there are any other comments I'll make additional changes as required, and thanks for creating |
Are you sure? I'm often very much interested in how a good-looking diagram was generated. I agree that putting a whole blob of unstructured plotting code into a huge code cell is likely distracting to readers. I recommend moving most of the auxiliary code into functions in a separate I'm doing this all the time, here's a random example: https://splines.readthedocs.io/en/0.3.2/euclidean/catmull-rom-non-uniform.html#Animation This way you are not hiding how to generate the diagram (and make it easier for a reader to understand), but you are still avoiding (most of) the noise.
Yes, there are many comments in #15, I don't want to copy all of them here, but for starters, here is one (from #15 (comment)):
Or what about this one (from #15 (comment)):
Admittedly, the link is broken, let me know if you don't find what I meant at that time. |
Thanks for the review @mgeier! I also like to know how good looking diagrams are generated. If you are creating them using dedicated Would using a different tag for hiding (or should I say removing) an input cell be sufficient (see for example https://jupyterbook.org/en/stable/interactive/hiding.html#removing-code-cell-content)? |
On the contrary, I definitely want users to be able to read them.
Yes, and I consider this good practice.
That's true, but I'd like to make it as easy as possible for readers. Having to open and sift through the source notebook is just an additional obstacle that I would like to avoid. Also, if there is no hint in the HTML-rendered version (because the input cell was hidden), readers might not know that there's even something hidden from them they could discover.
It would very helpful if you could assemble a list of which tags are used in different tools to hide/remove which kinds of cells. This list could then be a basis for deciding what to do in Also, it would help if you could find out what this means (and whether HTML is considered an "exported format"):
|
Resolves #15.
Removing a cell's input from the HTML/LaTeX output is done by adding the below to the cell metadata:
If you'd like to remove the entire cell from the HTML/LaTeX output you can use an already existing feature which accomplishes this by adding the below to the cell metadata: