Created
September 4, 2016 16:27
-
-
Save uolter/970adfedf44962b47d32347d262fe9be to your computer and use it in GitHub Desktop.
Hide code cells in Jupyter notebook
This file contains hidden or 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 | |
def hide_code(): | |
return 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> | |
The raw code for this IPython notebook is by default hidden for easier reading. | |
To toggle on/off the raw code, click <a href="javascript:code_toggle()">here</a>.''') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment