This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: [docbook-apps] Syntax coloring of programlisting
- From: techtonik <techtonik at tut dot by>
- To: Frans Englich <frans dot englich at telia dot com>
- Cc: docbook-apps at lists dot oasis-open dot org
- Date: Mon, 8 Nov 2004 20:31:11 +0200
- Subject: Re: [docbook-apps] Syntax coloring of programlisting
- Organization: .. ..
- References: <200411081808.15912.frans.englich@telia.com>
- Reply-to: techtonik <techtonik at tut dot by>
||*()*|| [\..konnichi wa, ogenki desu ka, Frans../]
FE> I looked around a bit, and the most portable, simplest, solution appeared to
FE> me to be to write templates which marked up the code; XSLT 2.0 have pretty
FE> good support for text-tokenization, judging from my shallow reading of what's
FE> new, compared to 1.0..
FE> The customization layer would add an attribute("code","programming-language"?)
FE> to the programlisting tag, which contained what programming language its
FE> content was, such that the templates could invoke as appropriate.
FE> Alternatively, could the Condition[2] attribute be used.
The most portable and simplest are incompatible solutions. =)
PHP Manual uses regular expressions to find and highlight DocBook
output <code> sections. If you need Java or C solution - take a look
onto http://colorer.sf.net. It is free library, plugins available for
Eclipse and Far Manager. Colorer uses XML files to store infomation
about dozens of file formats. I think it is rather complicated task
for XSLT stylesheet. Though it is possible that colorer uses some
similar techniques, since it's highlightning configuration is
at least well-formed. =)
--
//Old Rusty Cans Killers [ORCK]:
//technically yours, techtonik