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


Help: OASIS Mailing Lists Help | MarkMail Help

docbook message

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

Subject: RE: [docbook] controlling the line length of programlisting

Hi David,

Thanks for pointing out this section in Bob Stayton's book. However, if I'm reading the section correctly,
the breaking of text is done during the build processing.  Wouldn't it be easier if we could alert the writer right away
that he/she needs to edit the programlisting? My software package has print margin feature, but it is only available in the
text mode.

Any suggestions?


"David Cramer" <dcramer@motive.com>

06/22/2009 03:34 PM

<Kate.Wringe@sybase.com>, <docbook@lists.oasis-open.org>
RE: [docbook] controlling the line length of programlisting

See the following section from Bob Stayton's book about using a hyphenation character (e.g. an arrow of some kind) to indicate that a line in a programlisting has been broken for typographical reasons:

From: Kate.Wringe@sybase.com [mailto:Kate.Wringe@sybase.com]
Monday, June 22, 2009 2:25 PM
[docbook] controlling the line length of programlisting

Has anyone tried to use schematron to enforce the line length of programlisting?

We want to be able to limit the line-length of our programlistings when we are authoring.

That is, we need to be informed when a line length in a programlisting exceeds a number of characters (e.g., 72)

so that we can go in and format the lines properly. E.g., I'm imagining that this would involve counting the number of characters before a eol and then comparing

this number against the character limit (72).

If anyone has an alternative suggestion, that would be greatly appreciated.

Thank you,


Subject: Re: [docbook] prettyprinting code snippets

On Fri, Jun 12, 2009 at 19:01, DavePawson<davep@dpawson.co.uk> wrote:
> Mauricio Tavares wrote:
>>    I am writing a an article in which I am including quite a few xml
>> examples and snippets. I have been using <programlisting> but was now
>> wondering if there is a way I can prettyprint those snippets. Anyone?
> ONly if the code is well laid out in the first place?
> I try to break lines at <= 70 chars to make sure
> it fits on a screen.
> If you want code highlighting etc.. sorry no.

When the PHP documentations where using DocBook-XSL we used to add a
customization layer to add special "tags" around <programlisting>, and
then post process the output to syntax highlight and format examples
(php, xml, ..).

For example with <programlisting role="php"><?php..
?></programlisting> the customization layer would generate
"<phpcode><?php.. ?></phpcode>" that was then post processed with
other applications.

Currently we are using "PhD" (PHP based Docbook Renderer) which
handles all these kinds of things :)



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