Hi,
I think there is an easy to do it:
1/ the {toc} macro (written #toc() until we get the radeox<->velocity
mapping) can change the context object to set a value that says
numbering should be activated.
2/ the radeox heading filter can check the numbering flag in the context
and decide to include numbering.
You can use the XWikiContext to store the information.
To get the xwiki context in the filter you do:
RenderEngine engine = context.getRenderContext().getRenderEngine();
XWikiContext xcontext.getContext();
Ludovic
Jiri Luzny a écrit :
Hi,
I'm working on a design of Table of Contents feature and I need a help
of some XWiki expert ;-)
As an optional feature the {toc} tag should allow to specify if both
TOC and the actual headings should be automatically numbered (the same
how it works in Word).
To add the numbering into items in TOC section during a processing of
a TOC velocity macro is simple but to add the number just before a
text of heading in the actual content means to change the existing
content in the middle of rendering. I was thinking of modifying
filter.heading.print Radeox filter (BTW an easy way for adding an
anchor into headings) to encapsulate the heading text by a velocity
macro (which will then share the same numbering logic/variables with
the TOC macro) and then let it process by VelocityRenderer.
Unfortunately it doesn't work because VelocityRenderer is called
before RadeoxRenderer in the chain of renderers.
So, is it possible to change content of document being rendered from
within a velocity or groovy macro? If not, is there other flexible way
of this kind of changing of existing document content during rendering
phase than to modify an existing renderer or create a new one?
Thx,
Jiri.
------------------------------------------------------------------------
--
You receive this message as a subscriber of the xwiki-dev(a)objectweb.org mailing list.
To unsubscribe: mailto:xwiki-dev-unsubscribe@objectweb.org
For general help: mailto:sympa@objectweb.org?subject=help
ObjectWeb mailing lists service home page:
http://www.objectweb.org/wws
--
Ludovic Dubost
XPertNet:
http://www.xpertnet.fr/
Blog:
http://www.ludovic.org/blog/
XWiki:
http://www.xwiki.com
Skype: ldubost AIM: nvludo Yahoo: ludovic