How to right-align columns content in reStructuredText simple tables?

Sadly I don’t think rst offers that ability… the table styling options are rather limited. That said, if you’re rendering to HTML, you could add a custom stylesheet with a css rule such as: table.right-align-right-col td:last-child { text-align: right } and then add the directive: .. rst-class:: right-align-right-col right above your table in the rst … Read more

How do you get Python documentation in Texinfo Info format?

Jon Waltman http://bitbucket.org/jonwaltman/sphinx-info has forked sphinx and written a texinfo builder, it can build the python documentation (I’ve yet done it). It seems that it will be merged soon into sphinx. Here’s the quick links for the downloads (temporary): http://dl.dropbox.com/u/1276730/python.info http://dl.dropbox.com/u/1276730/python.texi Steps to generate python doc in texinfo format: Download the python source code Download … Read more

How to remove the cause of an unexpected indentation warning when generating code documentation?

Just add a blank line after the summary description of the method, before the description of the parameters: “”” Gtk.EventBox::button-release-event signal handler. :param widget: The clicked widget (The Gtk.EventBox). :param event: Gdk.EventButton object with information regarding the event. :param user_data: The Gtk.LinkButton that should be opened when the Gtk.EventBox is clicked. :return: None “”” Here … Read more

How to make an internal link to a heading in sphinx restructuredtext without creating arbitrary labels?

reStructuredText supports implicit hyperlink targets. From the reStructuredText quick reference: Section titles, footnotes, and citations automatically generate hyperlink targets (the title text or footnote/citation label is used as the hyperlink name). So the following text (lifted from the reStructuredText quick reference, spelling mistakes and all): Titles are targets, too ======================= Implict references, like `Titles are … Read more

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