Vincent Massol wrote:
Hi Paul,
What you need is to implement a Radeox SourceCodeFormatter and make it available so that it can be loaded by Radeox. Here's the code in Radeox CodeMacro.java:
Iterator formatterIt = Service.providers(SourceCodeFormatter.class);
(see http://java.sun.com/j2se/1.4.2/docs/guide/jar/jar.html#Service%20Provider) .
However this means that radeox will look for a META-INF/services/ org.radeox.macro.code.SourceCodeFormatter file in Radeox's JAR.
That files currently contains:
org.radeox.macro.code.SqlCodeFilter org.radeox.macro.code.JavaCodeFilter org.radeox.macro.code.XmlCodeFilter org.radeox.macro.code.NullCodeFilter
One way I guess would be to repackage a radeox JAR with your java class inside + a modified META-INF/services/ org.radeox.macro.code.SourceCodeFormatter file.
The other possibility is to modify XWiki so that it allows specifying new source code formatters in xwiki.cfg for example.
I think that putting our own org.radeox.macro.code.SourceCodeFormatter file inside xwiki-platform-core/xwiki-core/src/main/resources/META-INF would be enough, but I'm not sure.
Thanks -Vincent
On Nov 27, 2007, at 6:19 PM, Paul Grodt wrote:
I'm interested in adding support for rudimentary highlighting of C++ within the code macro. Should this be a separate issue from http://jira.xwiki.org/jira/browse/XWIKI-864 ({code} macro should support highlighting for radeox and velocity), or should this issue be extended to include it?
Should I investigate adding this directly to the Radeox project instead? I really don't know much about Radeox yet, but from the documentation for the code macro, it sounds as though all the existing highlighting code comes out-of-box from Radeox
Paul D. Grodt