This is the mail archive of the
docbook@lists.oasis-open.org
mailing list for the DocBook project.
Re: [docbook] Programming language in programlisting
- From: Tobias Reif <tobiasreif at pinkjuice dot com>
- To: docbook at lists dot oasis-open dot org
- Cc: Lars Trieloff <lars at trieloff dot net>
- Date: Mon, 31 Mar 2003 23:08:54 +0200
- Subject: Re: [docbook] Programming language in programlisting
- References: <20030331200505.GA6882@notebook>
Lars Trieloff wrote:
I am writing a Saxon-Extension for Syntax-Highlighting code in
programlistings.
Here's one for XML (not yet finished), written in XSLT 2:
http://www.pinkjuice.com/howto/vimxml/xslt/tinydbk2xhtml/markup_xml.xslt2
It matches XHTML code
template match="code[ at class='XML' and not(*)]"
You could easily modify this line to match DocBook code.
Sample output:
http://www.pinkjuice.com/howto/vimxml/tasks.xml#generatingxml
and at the bottom of
http://www.pinkjuice.com/howto/vimxml/intro.xml
It's part of the prototype
http://www.pinkjuice.com/howto/vimxml/about.xml#sources
and will be part of Doxy
http://www.pinkjuice.com/doxy/
If you'll ever write syntax markup XSLTs (be it in XSLT 1 or 2) for any
programming lang or syntax, perhaps you want to make them available.
My question is, how to specify the programming language
of the code in the programlisting.
As I understood lang, it is only for human languages. The other option
seems to be role, so which version is better?
<programlisting lang="java">
or
<programlisting role="java">
This is insufficient, and not concise IMHO. No (syntax) tool can know
that the syntax is Java.
See my RFE, RFE 692319
http://sourceforge.net/tracker/index.php?func=detail&aid=692319&group_id=21935&atid=373750
eg
<programlisting role="ClassTemplate" syntax="Java"
Tobi
--
http://www.pinkjuice.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-unsubscribe at lists dot oasis-open dot org
For additional commands, e-mail: docbook-help at lists dot oasis-open dot org