On 2012-08-27, Boris Kheyfets wrote:

> [-- Type: text/plain, Encoding:  --]

> I wont to cite code word-wraped in code-block. I can turn on the line 
> numbers to preserve the integrity. This can be done by adding

>     white-space: pre-wrap;

> to pre in css.

> However sometimes I cite csv files -- and I don't want them to wrapped. 

> It would be nice to have :nowrap: and :pre-wrap: options of code block.

> Do You think I can currently emulate this option -- that is to have pre 
> wrapped at one parts of rst file, and no-wraped in other parts? (while both 
> in code-block)

You can always add a class argument, either via::

   .. code::  <language>
      :class: wrapped
      
      code that wraps in language <language>

The "class" directive option can also be given to the "include" directive
(e.g. for included cvs files)::

   .. include myfile.cvs
      :code: text
      :class: nowrap

A literal block, can be preceded with a "class" directive::
  
   Now some literal block:

   .. class:: wrapped
   
   ::
   
      literal block with the "wrapped" class
      
See http://docutils.sourceforge.net/docs/ref/rst/directives.html especially
http://docutils.sourceforge.net/docs/ref/rst/directives.html#class
for details.
      
I'd style the default to use the more often required wrapping mode and
use either "wrap" or "nowrap" class argument (with another rule in the
custom CSS sheet) for the exceptions.

Günter
      
            

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to sphinx-dev@googlegroups.com.
To unsubscribe from this group, send email to 
sphinx-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en.

Reply via email to