Skip to content

Instantly share code, notes, and snippets.

@akafael
Created August 6, 2017 23:09
Show Gist options
  • Save akafael/864448313128236e95a4c10dabbfd043 to your computer and use it in GitHub Desktop.
Save akafael/864448313128236e95a4c10dabbfd043 to your computer and use it in GitHub Desktop.
Tougle Hide Button for ipython code cells
<!-->
Hide Button for code
Put as part of a markdown cell
</!-->
<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