Hide cells both in jupyterlab and myst rendering#335
Conversation
|
Test failures are not related to changes here and this is ready for review and merge. With the review I mean @jkrick or @troyraen - please have a look at the rendering to see if you are happy with the hidden cells, e.g. in here: https://circle.scientific-python.dev/output/job/701f33d8-d06c-4171-9a38-d0054519489e/artifacts/0/_build/html/openuniverse2024-tde-light-curve Other option is that we can hide input or we can hide output, right now I went with hiding the whole cell. |
|
Thanks for working on this. I think this is an improvement over having the code cells in the notebook. I don't like that the hidden cell in the rendering says "Notebook ...". Do we have the ability to change that text phrase to be something of our choosing? ie., "Function Definitions" or "Code Cell" or ?? |
troyraen
left a comment
There was a problem hiding this comment.
Thanks @bsipocz! This will be helpful.
I see a couple cells that produce figures so I feel they should use hide-input instead of hide-cell so the figures are still displayed by default. I'll mark them. But actually I don't see a reason not to just use hide-input for everything.
hidden cell in the rendering says "Notebook ...". Do we have the ability to change that text phrase to be something of our choosing?
I agree it would be great to customize the text if possible so the user sees something more informative than "Notebook Cell". I checked docs and found that according to myst-nb docs (which might not be relevant), it might be possible with something like:
---
jupyter:
source_hidden: true
tags: [hide-cell]
mystnb:
code_prompt_show: "Show code"
code_prompt_hide: "Hide code"
---
That doesn't work for me when building locally, but I'm building with myst start so it may still work in production with npm.
| --- | ||
| jupyter: | ||
| source_hidden: true | ||
| tags: [hide-cell] |
There was a problem hiding this comment.
| tags: [hide-cell] | |
| tags: [hide-input] |
| --- | ||
| jupyter: | ||
| source_hidden: true | ||
| tags: [hide-cell] |
There was a problem hiding this comment.
| tags: [hide-cell] | |
| tags: [hide-input] |
sure, I was very much on the fence if it should be hide-cell or hide-input, so will just change everything to hide-input.
We don't use myst-nb, that is part of the old JB1 stack |
|
Afaik there is no way currently to customise the text, but I made a note about it and will follow-up upstream. |
|
I'm going ahead and merge this now. All the test failures are unrelated and are due to some yet unchartered problem with the TDE notebook. The same errors are present in the more relevant PR #326, so we should focus on fixing them there or open a separate issue for it. |
Hide cells both in jupyterlab and myst rendering 6f539ca
Experimenting with a bit back and forth with Angus, I found a solution that apparently works for both usages we have. Draft as I still need to run a grep/sed to change all. And will also need to follow-up with a bit of documentation cleanup in the mystmd docs.
#myst-education-2026
closes https://github.com/IPAC-SW/irsa-datascience/issues/171