Source code pretty printer with DocBook or XML output?

邮差的信 提交于 2019-12-23 00:29:31

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!