Skip to content

Instantly share code, notes, and snippets.

@mutairibassam
Last active December 17, 2020 06:15
Show Gist options
  • Save mutairibassam/e797d5fdc3f4c2dd3fc1845186c3770c to your computer and use it in GitHub Desktop.
Save mutairibassam/e797d5fdc3f4c2dd3fc1845186c3770c to your computer and use it in GitHub Desktop.
To toggle on/off the raw code in jupyter notebook.
# hiding code for proper presentation
from IPython.display import HTML
HTML('''<script>
code_show=true;
function code_toggle() {
if (code_show){
$('div.input').hide();
} else {
$('div.input').show();
}
code_show = !code_show
}
$( document ).ready(code_toggle);
</script>
The raw code for this IPython notebook is by default hidden for easier reading.
To toggle on/off the raw code, click <a href="javascript:code_toggle()">here</a>.''')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment