Skip to content

Instantly share code, notes, and snippets.

@gabraganca
Last active February 15, 2017 17:37
Show Gist options
  • Save gabraganca/7097067 to your computer and use it in GitHub Desktop.
Save gabraganca/7097067 to your computer and use it in GitHub Desktop.
Template to use with `ipython nbconvert` when generating HTML. With this, all input cell are hidden. Thanks @damianavila for the initial setup (http://www.damian.oquanta.info/posts/hide-the-input-cells-from-your-ipython-slides.html). I have also take some code from the `custom.css` of @olgablot published in http://nbviewer.ipython.org/5357268.
{%- extends 'full.tpl' -%}
{% block input_group -%}
<div class="input_hidden">
{{ super() }}
</div>
{% endblock input_group %}
{%- block header -%}
{{ super() }}
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<style type="text/css">
//div.output_wrapper {
// margin-top: 0px;
//}
.input_hidden {
display: none;
// margin-top: 5px;
}
div.prompt {
display: none;
}
.CodeMirror{
font-family: "Consolas", sans-serif;
}
pre, code, kbd, samp {
font-family: Consolas, monospace;
font-size: 100px;
}
p {font-size:14px;}
div.cell{
max-width:80%;
margin-left:auto;
margin-right:auto;
}
div.text_cell_render{
max-width:90%;
margin-left:auto;
margin-right:auto;
}
h1 {
text-align:center;
font-familly:"Charis SIL", serif;
</style>
<script>
$(document).ready(function(){
$(".output_wrapper").click(function(){
$(this).prev('.input_hidden').slideToggle();
});
})
</script>
{%- endblock header -%}
@ibell
Copy link

ibell commented Feb 22, 2014

Nice work, this is awesome.

One comment

  • 100px font size is too large; 12px is better

@gabraganca
Copy link
Author

Thanks for the hint. I will try that.

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