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

How do you put HTML or XML into a YAML?

Example Here is a sample record from a YAML-based snippet management system I created years ago: – caption: fieldset msie5 tinycap: fieldset domain: html desc: fieldset and legend tag wwbody: | <fieldset> <legend>legend</legend> </fieldset> You can repeat that or something like it for all the snippets you want to manage. This particular system stores the … Read more

Why does this C# code return what it does

There are two things happening here. One is member hiding. This is fairly well-known and covered elsewhere. The other, less-known feature is interface re-implementation covered in section 13.4.6 of the C# 5 specification. To quote: A class that inherits an interface implementation is permitted to re-implement the interface by including it in the base class … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)