Created
September 16, 2016 06:52
-
-
Save quizzicol/a879c3efc781968876dbf6c8bc78d06e to your computer and use it in GitHub Desktop.
Jupyter notebook hide code cells
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 | |
HTML('''<script> | |
function code_toggle() { | |
if (code_shown){ | |
$('div.input').hide('500'); | |
$('#toggleButton').val('Show Code') | |
} else { | |
$('div.input').show('500'); | |
$('#toggleButton').val('Hide Code') | |
} | |
code_shown = !code_shown | |
} | |
$( document ).ready(function(){ | |
code_shown=false; | |
$('div.input').hide() | |
}); | |
</script> | |
<form action="javascript:code_toggle()"><input type="submit" id="toggleButton" value="Show Code"></form>''') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment