Skip to content

Instantly share code, notes, and snippets.

@dkapitan
Created December 30, 2016 10:00
Show Gist options
  • Save dkapitan/c63058e30576ca35083117e7a2da2e0b to your computer and use it in GitHub Desktop.
Save dkapitan/c63058e30576ca35083117e7a2da2e0b to your computer and use it in GitHub Desktop.
Toggle code in jupyter notebook
<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