Class parameter is not effective in code directive (rst2latex)

Sébastien Dailly <[email protected]>
Newsgroups gmane.text.docutils.user
Message-ID <[email protected]>
Hello,

I'm stuck with rst2latex : I want to customize the code-block rendering 
with a dark background. rst2latex translate this directive to a quote 
environnment which I can't override because it is already used elsewhere 
in the document.

I've tried to add a class parameter to the directive

> 
>   .. code-block:: C
>     :class: darkBackground
> 
>     // Comment
> 

But this does not seems to work (the class parameter is discarded)

> \begin{quote}
> {\ttfamily \raggedright \noindent
> \DUrole{comment}{\DUrole{single}{//~Comment\\
> }}~\\

I've also tried to wrap the code directive inside a class one :

> .. class:: darkBackground
> 
>   .. code-block:: C
> 
>     // Comment

But this does not give the expected result.

This seems to be a problem with the writer, because rst2html gives the 
class in the output :

> <pre class="code C darkBackground literal-block">
>  <span class="comment single">// Comment

Is this a known bug ? Is there a workaround for this ?

Thanks a lot !

-- 
Sébastien

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Docutils-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/docutils-users

Please use "Reply All" to reply to the list.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.