Skip to content

Instantly share code, notes, and snippets.

@trigfa
Created December 4, 2015 09:16
Show Gist options
  • Save trigfa/8f0b45d6f71fa3956ff5 to your computer and use it in GitHub Desktop.
Save trigfa/8f0b45d6f71fa3956ff5 to your computer and use it in GitHub Desktop.
Hide input cells and prompts in Jupyter notebook. Useful if using RISE for slideshow
%%HTML
<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>
@trigfa
Copy link
Author

trigfa commented Dec 4, 2015

The code should be used in the first cell of the notebook. It's useful if you are using the excellent RISE for producing slideshows from a Jupyter notebook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment