There is no postprocessor to exclude cells from the final output when converting Jupyter notebooks to markdown. One solution for this is to use custom templates as outlined in this gist.
Instructions:
- Put the
conf.json
andindex.md.j2
into a folder for example./templates/markdown2
- In your Jupyter notebook add the tag
remove
to the cells that should be removed after executing cells - Run the following command to execute and convert the notebook:
jupyter nbconvert notebook.ipynb --execute --to markdown --TemplateExporter.extra_template_basedirs=./templates --template markdown2
Resources:
- Info on running with custom templates
- Template structure (I only found this for 5.6.1 and have no idea where this info is for newer versions)
- Jinja docs
- Inspiration