Last active
April 19, 2023 17:57
-
-
Save davipatti/f9e32bb575871307d42e1043e1826b98 to your computer and use it in GitHub Desktop.
[jupyter notebook toggle code cells] Snippet for hiding code cells in a jupyter notebook #jupyter #ipynb #python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from IPython.display import HTML | |
HTML(""" | |
<script> | |
code_show = true; | |
function code_toggle() { | |
if (code_show) { | |
$('div.input').hide(); | |
} else { | |
$('div.input').show(); | |
} code_show = !code_show | |
} $(document).ready(code_toggle); | |
</script> | |
<font size='2'><a href='javascript:code_toggle()'>Toggle code.</a></font> | |
<hr /> | |
""") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment