Maybe you can do the wrapping via css. Just add these lines to "pre" tag. It
works for me:

white-space : pre-wrap; /*for Mozilla*/
word-wrap: break-word; /*for IE*/



2009/9/15 Elaine Angelino <[email protected]>

> wait -- for the html build, no parsing is necessary, it would just be a
> matter of soft-wrapping the lines of code instead of using a scroll bar for
> a code block.  is this possible?
>
> (this obviously doesn't solve the problem for pdf latex)
>
>
>
> On Tue, Sep 15, 2009 at 8:41 AM, Elaine Angelino <
> [email protected]> wrote:
>
>> ahh that is a good point!  no quick fix in general...
>>
>>
>>
>> On Tue, Sep 15, 2009 at 8:27 AM, Roberto Alsina <
>> [email protected]> wrote:
>>
>>>
>>> On Tuesday 15 September 2009 09:22:45 elaine wrote:
>>> > hi there --
>>> >
>>> > i think what i have is a reST question and am hoping for a reST or
>>> > sphinx solution:
>>> >
>>> > lines of regular text in reST wrap automatically.  however, if i have
>>> > a very long line in a code block, it does not wrap automatically (e.g.
>>> > results in a scroll bar in an html representation, or is simply cut
>>> > off the page in the pdf build of a latex representation).  is there a
>>> > quick fix for this, or do i have to format this by hand?
>>> >
>>> > thanks very much!
>>>
>>> There is no possible "correct" solution for this.
>>>
>>> Since it's code, it can't be automatically wrapped, because it breaks[1].
>>>
>>> In rst2pdf I offer a "shrink" fit where the font size is decreased until
>>> it
>>> fits the page, but it's not meant for production usage (you can end with
>>> completely unreadable blocks!)
>>>
>>> So, I expect the answer is "yes, you need to format it by hand".
>>>
>>> And the really bad news: you probably need to format it by hand again for
>>> printing, if you want to print.
>>>
>>> [1] Ok, if you know the language you *could* wrap it in some cases. But
>>> in
>>> arbitrary code blocks you don't.
>>>
>>> --
>>>  ("\''/").__..-''"`-. .         Roberto Alsina
>>>  `9_ 9  )   `-. (    ).`-._.`)  KDE Developer (MFCH)
>>>  (_Y_.)' ._   ) `._`.  " -.-'  http://lateral.netmanagers.com.ar
>>>  _..`-'_..-_/ /-'_.'     The 6,855th most popular site of Slovenia
>>> (l)-'' ((i).' ((!.'       according to alexa.com (27/5/2007)
>>>
>>>
>>>
>>
>
> >
>

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

Reply via email to