Sphinx, reStructuredText show/hide code snippets
You don’t need a custom theme. Use the built-in directive container that allows you to add custom css-classes to blocks and override the existsting theme to add some javascript to add the show/hide-functionality. This is _templates/page.html: {% extends “!page.html” %} {% block footer %} <script type=”text/javascript”> $(document).ready(function() { $(“.toggle > *”).hide(); $(“.toggle .header”).show(); $(“.toggle .header”).click(function() … Read more