[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Syntax coloring of programlisting
On Tuesday 09 November 2004 10:13, Oliver Horn wrote: > Hi Frans, > > >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? > > I've implemented something similar as XSLT extension function. The > extension function takes two string parameters (the first parameter > contains the plain code fragment, the second parameter defines its > language) and returns an interim node-set representing the tokenized > program. In a second step, the returned node-set can be processed > further, e.g. transformed into formatted output. > > My implementation is written for SAXON 6.5 and makes use of the free > jEdit Syntax Package [1] which performs the actual tokenization. The > implementation is just a few lines of Java code. I think a similar > extension for other (Java-based) XSLT processors or syntax highlighting > packages would be straight-forward. If you (or anyone else) is > interested in it, I can publish the source. That would likely be useful, perhaps you can attach it to a mail in this thread? In order to avoid future confusion, you could put a license header of your choice in every file. Cheers, Frans
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]