Skip to content

Instantly share code, notes, and snippets.

@GeauxEric
Created February 19, 2016 19:22
Show Gist options
  • Select an option

  • Save GeauxEric/99fc4ee1916329dd7a51 to your computer and use it in GitHub Desktop.

Select an option

Save GeauxEric/99fc4ee1916329dd7a51 to your computer and use it in GitHub Desktop.
toggle the code cell in the html output of ipython notebook
<!-- thanks to https://github.com/Saynah -->
<script>
var code_show=true; //true -> hide code at first
function code_toggle() {
$('div.prompt').hide(); // always hide prompt
if (code_show){
$('div.input').hide();
} else {
$('div.input').show();
}
code_show = !code_show
}
$( document ).ready(code_toggle);
</script>
<a href="javascript:code_toggle()">[Toggle Code]</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment