Created
May 29, 2019 11:54
-
-
Save alaudet/a7180e37da171d28f5d6f71054a4803a to your computer and use it in GitHub Desktop.
Toggle Code View in Jupyter
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
# Source: https://stackoverflow.com/questions/27934885/how-to-hide-code-from-cells-in-ipython-notebook-visualized-with-nbviewer | |
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> | |
<form action="javascript:code_toggle()"><input type="submit" value="Toggle Code View"></form>''') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment