One of the things I've found my self doing more and more is making use of cell tags (particularly the active-ipynb tag in Jupytext to comment out code cells in paired text documents).
Spotting a Twitter cry against using R backed notebooks in Jupyter and note being able to invoke Rmd style echo=FALSE tags, this made me:
a) think of the hide_code extension;
b) wonder about Rmd code chunk options;
c) wonder whether a tags based approach might be a useful addition to hide_code (I find I don't get on with cell toolbars very well; I prefer a text approach).
Rmd chunk options include (from the docs):
include = FALSE: prevents code and results from appearing in the finished file. R Markdown still runs the code in the chunk, and the results can be used by other chunks.
echo = FALSE: prevents code, but not the results from appearing in the finished file. This is a useful way to embed figures.
message = FALSE: prevents messages that are generated by code from appearing in the finished file.
warning = FALSE: prevents warnings that are generated by code from appearing in the finished.
fig.cap = "..."
I wonder if it would be useful to try to mirror that in a set of suitably processed notebook tags. (hide_code already has a lot of machinery that can handle the processing, I think?)
I'm not sure what the best form for tags would be? Possibilities might include:
Adding one of these tags would then invoke the appropriate code hiding / output displaying option(s).
I don't think there is much machinery for supporting tag mediate display in notebooks yet (certainly, I'd also like an easy way to to be able to tag a cell so it could be styled / themed differently to other cells (eg here) but maybe that's just me!
One of the things I've found my self doing more and more is making use of cell tags (particularly the
active-ipynb
tag in Jupytext to comment out code cells in paired text documents).Spotting a Twitter cry against using R backed notebooks in Jupyter and note being able to invoke Rmd style
echo=FALSE
tags, this made me:a) think of the
hide_code
extension; b) wonder about Rmd code chunk options; c) wonder whether a tags based approach might be a useful addition tohide_code
(I find I don't get on with cell toolbars very well; I prefer a text approach).Rmd chunk options include (from the docs):
include = FALSE
: prevents code and results from appearing in the finished file. R Markdown still runs the code in the chunk, and the results can be used by other chunks.echo = FALSE
: prevents code, but not the results from appearing in the finished file. This is a useful way to embed figures.message = FALSE
: prevents messages that are generated by code from appearing in the finished file.warning = FALSE
: prevents warnings that are generated by code from appearing in the finished. fig.cap = "..."I wonder if it would be useful to try to mirror that in a set of suitably processed notebook tags. (
hide_code
already has a lot of machinery that can handle the processing, I think?)I'm not sure what the best form for tags would be? Possibilities might include:
echo
/no-echo
echo=true
/echo=false
/echo=True
/echo=False
/echo=T
/echo=F
echo-true
/echo-false
/echo-True
/echo-False
/echo-T
/echo-F
Adding one of these tags would then invoke the appropriate code hiding / output displaying option(s).
I don't think there is much machinery for supporting tag mediate display in notebooks yet (certainly, I'd also like an easy way to to be able to tag a cell so it could be styled / themed differently to other cells (eg here) but maybe that's just me!