On 31 Dec 07, at 5:10 AM 31 Dec 07, Vincent Massol wrote:
On Dec 31, 2007, at 1:45 PM, Vincent Massol wrote:
Hi,
I've been thinking about some use case we might have in XWiki and
I'm wondering how to solve them using Doxia.
Imagine we want the rendering process to automatically look for
word definition on, say, wikipedia, and when found, highlight the
word and make the definition appear when the mouse hover over the
word.
This is probably not the best use case since a better way of
implementing this would be with a {definition} macro.
Here's another one: adding support for wikiwords and render them as
links.
I think adding word processing to the API would be a good thing.
That's probably a pretty common use case.
Of course if this is a core feature it can be implemented in the
parser itself. However in case of XWiki it's not a core feature but
I know some users have asked for it. The way we currently support
this is by allowing users to customize the rendering process by
adding radeox filters. The way I would expect users to do it with
Doxia would be by extending the XWiki Sink classes or providing
their own Sink. I think it would be way harder to offer hook points
into the parser for users.
I think if we covered all typographical formatting (bold, italic), and
word processing I think the API would be pretty complete. If you were
to do any sort of common processing like index a document with lucene
you need to get at the word tokens.
How would we do this with Doxia since there's no onWord event?
Of course it's possible for the sinks to parse the strings passed to
the text() event. However this is probably a job best left to the
parsers IMO.
I think making an addition to the API to allow finer grained access to
the words would be great.
I think wiki-model might a little over the top with the things it
gives access to. I think if we look at your cases, and the common case
of indexing we'll find what level of granularity we need. But
processing words I think is something valuable to add.
WDYT?
Wikimodel does have such an event (they even have events such as
onSpace and onSpecialSymbol, onEmptyLines, onEscape, etc):
http://tinyurl.com/yuuh2d
Thanks
-Vincent
Thanks,
Jason
----------------------------------------------------------
Jason van Zyl
Founder, Apache Maven
jason at sonatype dot com
----------------------------------------------------------
Script timed out