I am trying to clean up a Jupyter notebook so it can be distributed and I figured out that you can insert CSS into a code cell using e.g.
HTML("""
<style>
body {
counter-reset: section; /* Set a counter named 'section', and its initial value is 0. */
}
h3::before {
counter-increment: section; /* Increment the value of section counter by 1 */
content: "Section " counter(section) ": "; /* Display the word 'Section ', the value of
section counter, and a colon before the content
of each h3 */
}
</style>
""")
However, it would be good if the code and output for this cell alone were suppressed from display. I don’t want to mess with a custom.css file and would prefer the solution to not depend on any ipython notebook extensions; this will make the notebook self-contained. Is there a way to do this?