Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

ibell commented Feb 22, 2014

Nice work, this is awesome.

One comment

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

This comment has been minimized.

Owner

gabraganca commented Apr 4, 2014

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