#202 Add support for `code-block` directive in docutils-0.9

open
nobody
None
5
2012-10-23
2012-10-23
marcman
No

docutils-0.9 added support for a `code-block` directive in reST. It does color syntax highlighting of code using Pygments.

Sphinx supports this and GitHub added support for this a few months ago so that I can have syntax-highlighted code in my project description (yay!) Unfortunately, when I publish the package on PyPI, it doesn't like this directive and in fact when it sees it, it decides that the entire description is plain-text instead of reST so I get an ugly description, unless I remove my `code-block` directives.

`sourcecode` (a seeminglyunofficial directive that some stuff used before docutils added `code-block`) doesn't work either.

The `code-block` directive was added recently in docutils-0.9; adding support for it _might_ be as simple as upgrading the installation of docutils on the pypi servers and installing Pygments.

Discussion

  • Richard Jones
    Richard Jones
    2012-10-25

    docutils is currently installed from a debian package and I don't think there's a version newer than 0.7 (on test pypi) or 0.8 (on production pypi) available to install. Martin, is that correct?