OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] Break long programlisting lines without spaces?


On 04/14/2011 11:57 AM, hamilton@xmlpress.net wrote:
> Regarding this entire thread, I know an automatic method is attractive, and may make sense in some cases, but with programming examples, I think going fully automated is dangerous.
> 
> There are two competing questions:
> 
> 1) Does the example scan well to the eye?
> 2) If the reader types (or cuts and pastes) the example into a compiler/interpreter verbatim, will it work?

I'm willing to abandon #2 for pdf output. If you're online, you're
probably (or should be) using the html output we provide. Cutting and
pasting from html is more reliable/easier anyway. Pdfs are really for
printing.

> I don't know of any automated approach that can satisfy these two conditions consistently.
> 
> I think you're better off having the stylesheet warn you when you exceed a maximum line length, and then fixing the offending examples directly. If you do that, you can be assured that examples will work the same for readers who type or cut/paste the example as it the original example did.
> 
> Jirka does make a good point that you may not have that luxury, but if you don't, and you need to accept un-reviewed line breaks, then at least make files that contain the "true, unbroken" examples available for download.

Yes, there are cases where this is what you want. You have the option of
searching for the special autowrap character and manually modifying the
code sample so that the automatic break isn't necessary.

Some use cases require the auto-wrapping feature. In other cases,
killing the build if a line is too long is the right answer.

David



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]