I look at it later.

Emmanuel

Juan F. Codagnone a écrit :
Hi!

We did a java parser for TWiki [http://twiki.org/] that emits Sink messages. It doesn't handle all the features, but it support most of the things we use in our wiki.

This is implemented in an ad-hoc line-by-line parser (i was too lazy to remember the language compiler classes), but i think it is just fine for a free language as twiki. A disadvantage of line-by-line parser is that you must understand the parsing code, and some times it gets tricky. In this case, the parser is distributed in several classes for better understanding. The parsers generates a tree of Blocks (ease testing), and they can generates the sink messages (next step would be to decouple blocks from doxia). Every language feature was introduced by a unit test (ala TDD) so it is easy to detect when a change breaks something.

We didn't started to use it yet, but i think it is a usefull. If you found the code usable, we are looking forward that this code get to the doxia project. Being able to connect wiki written doc with a maven project is a nice feature...

For now, the code is available at:
   http://www.zauber.com.ar/project/sandbox/svn/trunk/doxia-zauber/
(be patient with the conection)

Any opinion/ suggestion is welcome.

Regards,
   Juan.

ps. attached there is a description of what is supported.



------------------------------------------------------------------------

---+ Twiki Java Parser

---++ Features

This parser of the [[http://www.twiki.org][TWiki]] text format supports most
of http://twiki.org/cgi-bin/view/TWiki/TextFormattingRules formatting commands.

---+++ General

   * Paragraps,
   * Wiki Words
      * WikiWord
* Web.WikiWord#anchor, * escaped: !WikiWord
   * Forced Links:
      * [[wiki word]]
      * escaped ![[wiki word]]
* Specific links: * [[http://www.zauber.com.ar][Zauber]],
      * prevention: ![[http://www.zauber.com.ar][Forced links]]
   * Anchors: [[#AnchorEnd][End]]
   * inline urls:
      * http://twiki.org/
   * mailto link:
      * [[mailto:[EMAIL PROTECTED] Mail]]
      * [[mailto:?subject=Hi Hi]]

---+++ Text Format:

   * *bold*
   * _italic_
   * __bold italic__
   * =Fixedfont=
   * ==Bold fixed==

And nested formats like:
   * *bold with _italic_ and some =fixed= and bold*
Make sure there is no space between the text and the bold, italic, or other
indicators (* _ __ = ==).

---+++ Lists

   * items
      * nested items
      * ordered list
         * arabic numerals
            1. item
            1. item
            1. ...
         * uppercase letters
            A. item
            A. item
            A. ...
         * lowercase letters
            a. item
            a. item
            a. ...
         * uppercase roman numerals
            A. item
            A. item
            A. ....
         * Uppercase Roman Numerals
            I. item
            I. item
            I. ...
         * Lowercase Roman Numerals
            i. item
            i. item
            i. ....

---+++ Separators

Up
---------------------------
Down

---+++ Table

 | *A* | *B* | *C* |
 | Foo | bar | Foo |
 | Bar | Foo | bar |
 | Foo | bar | Foo |

---++ Missing things
---+++ Verbating Mode
<verbatim>
class CatAnimal {
  void purr() {
      <code here>
}
</verbatim>

---+++ Definition List
(i don't use it)
   $ Sushi: Japan
      $ Dim Sum: S.F.
   $ Asado: Argentina

---+++ Diable Links

<noautolink>
   RedHat &
  SuSE
</noautolink>
---+++ Html
    *  <pre>some text</pre>

#EndAnchor

Reply via email to