Skip to content

Instantly share code, notes, and snippets.

@mgalardini
Created May 18, 2015 16:37
Show Gist options
  • Save mgalardini/84639f47a984fc0e930d to your computer and use it in GitHub Desktop.
Save mgalardini/84639f47a984fc0e930d to your computer and use it in GitHub Desktop.
Ipython notebook html template for code cells toggling
{% extends 'full.tpl' %}
{% block header %}
{{ super() }}
<script type="text/javascript">
show=true;
function toggle(){
if (show){
$('div.input').hide();
}else{
$('div.input').show();
}
show = !show
}
if(window.attachEvent) {
window.attachEvent('onload', toggle);
} else {
if(window.onload) {
var curronload = window.onload;
var newonload = function() {
curronload();
toggle();
};
window.onload = newonload;
} else {
window.onload = toggle;
}
}
</script>
{% endblock header %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment