You can also look at http://rendering.xwiki.org/xwiki/bin/view/Main/ExtendingMacro for more details.
On Wed, Apr 20, 2016 at 3:54 PM, Eduard Moraru <enygma2...@gmail.com> wrote: > Hi, > > You could look at a very simple "userAvatar" macro for inspiration: > https://github.com/xwiki/xwiki-platform/tree/master/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-macros/xwiki-platform-rendering-macro-useravatar > > Normally, you should: > - extend org.xwiki.rendering.macro.AbstractMacro, > - mark your implementation as an XWiki component (@Component) and give it a > name (@Named("colour")), > - register your component in your module's > main/resources/META-INF/components.txt, > - build and install your jar in your app's classpath, > - execute your macro ( > http://rendering.xwiki.org/xwiki/bin/view/Main/GettingStarted#HExecuteMacros > ). > > Hope this helps, > Eduard > > On Wed, Apr 20, 2016 at 10:51 AM, Thomas Wendel <drownedincof...@gmx.net> > wrote: > >> Hi, >> >> I am evaluating the XWiki Rendering Framework for a project of ours. >> >> It was no problem to create a little POC to render some sample XWiki syntax >> into HTML. Next I tried to write a little colour macro that simply renders >> some text in a colour which is specified as a macro parameter. However, I >> did not manage to get the macro executed. In the resulting HTML output I >> get the error message: >> >> Unknown macro: colour.The "colour" macro is not in the list of registered >> macros. Verify the spelling or contact your administrator. >> >> Now I have the following questions: >> >> Is it possible at all to render a macro and execute it standalone with the >> rendering framework (as opposed to running it in the XWiki Platform)? >> >> As mentioned above, I implemented a little POC application that simply >> renders XWiki syntax. The macro itself I implemented as a standalone jar. I >> put the macro jar in the class path and the macro's package to the >> context.txt of the POC application. Is that correct so far? >> >> Am I missing something totally altogether? >> >> Thanks for your help in advance. >> Regards, >> Thomas >> _______________________________________________ >> users mailing list >> users@xwiki.org >> http://lists.xwiki.org/mailman/listinfo/users >> > _______________________________________________ > users mailing list > users@xwiki.org > http://lists.xwiki.org/mailman/listinfo/users -- Thomas Mortagne _______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users