On 3/27/07, Zeljko Trogrlic <zeljko_t(a)post.htnet.hr> wrote:
Hi,
For our department Wiki, I really needed automatic links for acronyms
because we have a whole bunch for them. So, after couple of days playing
with code and regular expressions I managed to create Radeox filter,
which converts acronyms to links.
When you finalize it, you can post it in the code zone on
xwiki.org
My questions are:
1)
Is that the right approach to do that or I should write plug-in? Can you
write a plug-in that processes every page, or you have to call it
explicitly?
Yes, that is the right approach (for the moment). Plugins are usually more
complex, converting wiki syntax to html is the job of Radeox.
2)
What is the right place to attach it to rendering? I
attached it to the
end, just before link filter, but then I had to struggle with HTML. It
will be probably easier to write something that processes pure Wiki or
abstract syntax tree, but it seems to me that there is no such place in
Wiki.
There is no global right place, it all depends on how it is influenced or it
influences the rest of the filters. You have to analyze and test this. For
example, a bug regarding links and emphasizing syntax was fixed just by
reordering the filters.
An abstract syntax tree will be available once we switch from Radeox to
wikimodel.
If I do the processing immediately after page is loaded, macros are not
evaluated yet, therefore text generated by macros
can't be processed (I
don't know is this a big deal, though).
It seems to me that macros are generating HTML instead of Wiki, which is
not very clean. On the other hand it will be hard to write event simple
macros with formatted text (e.g. "warning") without generating HTML
directly, or introducing some kind of style tags for Wiki markup.
3)
Radeox status: What is your experienece with Radeox team? Is there
anybody still working on the project? I found some some funny stuff in
the source code, which I would like to fix. They "swallowed" exceptions
in some places, so if you mis-configure filter, you will not why it
doesn't work.
The Radeox team decided that it is perfect some time ago, although there are
some bugs, filters that should have been written differently, invalid markup
generated. Because of this, and the problems mentioned above (finding the
right ordering in order to avoid processing already generated HTML, lack of
a wiki abstract tree), we decided to move to WikiModel as soon as possible.
But this "ASAP" is not going to happen soon enough, so any patch you can
provide before XWiki 1.0 will be much appreciated.
Sergiu
--
http://purl.org/net/sergiu