Hello devs,
I'm working on some project outside XWiki which uses your rendering API.
Managed to wire everything and to define my custom macro, wrote some unit
tests but when I use another wiki dialect except XWIKI_2_0 (for instance
Creole) in the Converter, my macro is not recognized.
See sample code below:
// Initialize Rendering components and allow getting instances
ecm = new EmbeddableComponentManager();
ecm.initialize(this.getClass().getClassLoader());
Converter converter = ecm.lookup(Converter.class);
//Register my special custom macros
ComponentAnnotationLoader loader = new ComponentAnnotationLoader();
List<ComponentDescriptor> compDescriptors =
loader.getComponentsDescriptors(MySpecialMacro.class);
ecm.registerComponent(compDescriptors.get(0));
Converter converter = ecm.lookup(Converter.class);
WikiPrinter printer = new DefaultWikiPrinter();
// HERE IS THE PROBLEM WITH MY CUSTOM MACRO
converter.convert(new StringReader("{{link path='foo'}}"),
Syntax.CREOLE_1_0, Syntax.XHTML_1_0, printer);
So my problem is that I'd like to instruct the Creole parser or any other
parser except XWIKI_2 to correctly parse my custom macro. How can I do that?
I might be wrong, but I guess I'll have to implement some new parser to suit
my needs. In respect to that I've dug into the Converter class, saw it's
instantiation strategy, then followed the story until I've encountered
IWikiParser and all its subclasses (XWikiParser, CreoleParser etc ) which
I'm unable to find thier sources on the repository.
Could you please point me in the right direction?
Thank you!
--
View this message in context:
http://xwiki.475771.n2.nabble.com/How-to-instruct-a-wiki-parser-to-render-m…
Sent from the XWiki- Dev mailing list archive at
Nabble.com.