Re: [docbook-apps] Syntax coloring of programlisting

From
Stefan Seefeld <>
Date
2004-11-08T23:22:55+00:00
ID
Thread
Re: [docbook-apps] Syntax coloring of programlisting
[I reply I did earlier from a non-subscribed address seems to have been filtered
  out, so let me try again...]

Hi Frans,

Frans Englich wrote:
 > Hello all,
 >
 > I'm thinking about doing syntax highlightning of example code, typically found
 > in Docbook's programlisting[1] element. I've never seen this in Docbook, only
 > in web forums and such. Have anyone any experience with this, or is aware of
 > existing solutions?

The closest tool I could think of for what you want is 'enscript'. It knows how
to parse quite a number of languages, and supports multiple output formats,
such as ps and html.
I would just write together some scripts that inject the generated output (either
text or image) into the output stream.
I don't think docbook and docbook formatters are the right place to look for
parsers for programming languages, especially if your focus is on syntax, not
semantics.

Regards,
		Stefan