-
Notifications
You must be signed in to change notification settings - Fork 393
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
Markdown active and inactive cells #688
Comments
Hi @amin-nejad , sorry to answer so late! Yes I agree that I find useful to have control over which code cells are active or not in either the ipynb or the py file. I'd be curious to learn more about why you'd find useful to have some parts of the text included or not in the md or ipynb files... do you have a concrete example in mind? Also there is a technical detail that we must take into consideration here: currently, the text files (py or md files) always contain all the input cells of the notebook. So, if we ever implement something like this, maybe I'd have a preference to hide some markdown cells inside HTML comments rather than completely removing them. Is that something that would fit your use case? Or not? Thanks |
Hi @mwouts, no worries, thanks for your reply! My use case is when doing data analysis/modelling/visualisation, etc., a notebook is my preferred method because of its flexibility. But if I then want to present my findings/results to a wider group of people, I don't want to share the whole notebook showing all the iterations of things or things that might be less relevant/important to them (pretty much all the code input cells fall into this category, really just want some of the code outputs and some of the markdown cells). Given that most cells don't make it into the final report, it would be significantly easier to have all cells be not included by default unless they have a tag like Having them hidden would still fit my use case as I only care about what the rendered version would look like. I think including the outputs in markdown cells is still not there yet though if I'm right? It seems #220 concerns this which is still open. |
Hi @amin-nejad, I don't think #220 can be solved in the near future. According to the nbconvert documentation and to
(not tested) to build the final report. If you do so, please let us know how it works! Thanks. |
No worries and thanks for the tip, I have actually been using this in the meantime and it works well! It's not quite what I want as I want the inverse where we you choose what cells to include rather than what cells to exclude but it's close enough! I actually have an open issue there regarding this: jupyter/nbconvert#1488 I'll close this issue for now then if it's likely to be long term. Thanks again |
In markdown, we can add the
active="md"
cell metadata to have a code snippet not turn into a cell in the jupyter notebook version.Similarly, we can add the
active-ipynb
tag to notebook cells in order to control whether or not they are commented out in the python version.However it doesn't seem like there are any tags to control whether a notebook cell appears or doesn't appear in markdown. Am I mistaken?
If not, in that same vein, I was wondering if we could either:
active-md
tag where only the cells with that tag are outputted to the markdown version of the notebookactive-ipynb
also apply to the markdown formatOr something similar. Thanks!
The text was updated successfully, but these errors were encountered: