From 0285bbcec41e4ff7605e1f3e83f153586733d1c5 Mon Sep 17 00:00:00 2001 From: Igor Kalnitsky Date: Fri, 8 Feb 2013 01:47:20 +0200 Subject: [PATCH] Fix bug with docutils' code directive. Since version 0.9 `docutils` supports `code` directive. But this directive can generate fullname classes for the `pygments` style classes. For example, the following code ```reStructuredText .. code:: c++ GetFoo()->do_something(); ``` generate the following output ```html
  GetFoo
  ()
  ->
  do_something
  ();
``` Note, that fullname classes were used, when we need a short one ```html
  GetFoo
  ()
  ->
  do_something
  ();
``` --- pelican/readers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pelican/readers.py b/pelican/readers.py index 440bbdf8..f53f7350 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -110,7 +110,8 @@ class RstReader(Reader): return output def _get_publisher(self, source_path): - extra_params = {'initial_header_level': '2'} + extra_params = {'initial_header_level': '2', + 'syntax_highlight': 'short'} pub = docutils.core.Publisher( destination_class=docutils.io.StringOutput) pub.set_components('standalone', 'restructuredtext', 'html')