问题
Is there some source code pretty printer out there that is able to generate DocBook, or at least XML output from my C sources?
I want to include some good looking source code examples in my DocBook document.
回答1:
I'm not sure what you mean by a pretty-printer that generates XML, but if you want code examples in DocBook documents to be nicely colourized when transformed to HTML or FO/PDF output, take a look at XSLTHL. This is an XSLT extension module (written in Java) that decorates the content of <programlisting>
elements.
For details on using XSLTHL with with the DocBook XSL stylesheets, see http://docbook.sourceforge.net/release/xsl/current/doc/html/highlight.source.html.
来源:https://stackoverflow.com/questions/4906860/source-code-pretty-printer-with-docbook-or-xml-output