Doesn't work: rst file:
.. code:: python :class: nowrap for i in range(5): test test test test test test test test test test test test test test css file: I tried: pre.nowrap { white-space: nowrap; } div.nowrap { white-space: nowrap; } span.nowrap { white-space: nowrap; } none wraps the code. On Monday, August 27, 2012 5:31:40 PM UTC+4, Guenter Milde wrote: > > 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.htmlespecially > 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 view this discussion on the web visit https://groups.google.com/d/msg/sphinx-dev/-/Q1VVrB_l2VkJ. 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.