You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Fabio Rinaldi <ri...@ifi.unizh.ch> on 2004/08/22 13:57:52 UTC

tweaking wiki

Dear Forrest developers,

I have just joined your list upon suggestion from Dave Brondsema:

Dave Brondsema writes:
 > Quoting Fabio Rinaldi <ri...@ifi.unizh.ch>:
 > 
 > > 
 > > Dear Dave,
 > > 
 > > I am sending this message to you because it might be too
 > > technical or specific for the user list. However, feel free to send
 > > your reply to the list if you think it might be useful.
 > > 
 > 
 > Then please send it to dev@forrest.apache.org
 > 

This is my problem, hope you can help.

---
I started to play a little with the "wiki.grm" file, and
obtained a couple of interesting things which I would like to
use (like the "title" for wiki pages that I mentioned in a previous
message).  

However I feel that I should not mess up with the default wiki format,
otherwise things would become uncontrollable as soon as I install a
new Forrest distribution. So my idea is to create a separate "own"
wiki format, identified by a different file suffix,
e.g. mydocument.mywiki

Then I modified 'forrest.xmap' by duplicating the template that
matches "*.cwiki", modified the copy so that it matches "*.mywiki",
then tried to fiddle with the template so that I can make use of my
own versions of "wiki.gram" and "wiki2xdoc.xsl". For the latter, it is
easy, as it is explicitly pointed to in the template. However, I
do not know how to point 'forrest.xmap' to my own version of
"wiki.gram". It seems to make use of a cocoon identifier
"cocoon:/wiki.xgrm". Can this be customized? 

One of the possible reasons for this work would be to support an
alternative wiki format (e.g. MoinMoin Wiki). 

Regards,
Fabio

Dave Brondsema writes:
 > On Mon, 16 Aug 2004, Fabio Rinaldi wrote:
 > 
 > >
 > > Hi,
 > >
 > > according to the documentation at:
 > >
 > > http://forrest.apache.org/docs/wiki-sample.html
 > >
 > > {{text}}   = prints 'text' in monospaced font.
 > >
 > > However, I could not get this to work. This specification seems to be
 > > completely ignored: in the output I get the brackets and the text
 > > without any special font effect.
 > >
 > 
 > You're right.  The chaperon parser is used to parse the wiki files
 > (JSPWiki format) and nobody the transformations are not as complete as
 > JSPWiki itself.  Definition lists are also not supported and whitespace
 > matters a lot more than in JSPWiki.  If you'd like to try your hand at
 > adding support, these are the files in 0.6 (from SVN) to use:
 > 
 > src/core/context/resources/chaperon/grammars/wiki.grm
 > src/core/context/resources/chaperon/stylesheets/wiki2xdoc.xsl


Re: tweaking wiki

Posted by Dave Brondsema <da...@brondsema.net>.
David Crossley wrote:
> Dave Brondsema wrote:
> 
> 
>>We need to keep the chaperon  directory in sync with the block in 
>>cocoon.  They also asked (last time I made a change) that we update the 
>>selftest.txt as features change.
> 
> 
> I was just starting to write a followup message about that.
> 
> There is a big problem with that Cocoon selftest.
> The test is in the Cocoon block Chaperon samples.
> It generates a page which should synchronise with
> a demo page on the Cocoon Wiki. However, Cocoon has
> since migrated from the Cocoondev.org JSPWiki to the
> Apache Wiki using Moin Moin. So the self test is broken.
> 
> Does someone else have a JSP Wiki where we could have
> this selftest page?
> 

I run one at csx.calvin.edu but we may switch to confluence.  I would 
suggest using jspwiki.org itself.  We should have an additional page or 
two describing the Chaperon parser's capability to read JSPWiki files.

-- 
Dave Brondsema : dave@brondsema.net
http://www.splike.com : programming
http://csx.calvin.edu : student org
http://www.brondsema.net : personal

Re: tweaking wiki

Posted by David Crossley <cr...@apache.org>.
Dave Brondsema wrote:
> 
> I've done some cwiki modifications so I'll try to give a somewhat 
> thorough review tomorrow, time permitting.  I'm sure it'll be great 
> though, we appreciate the contribution.

Excellent.

> We need to keep the chaperon  directory in sync with the block in 
> cocoon.  They also asked (last time I made a change) that we update the 
> selftest.txt as features change.

I was just starting to write a followup message about that.

There is a big problem with that Cocoon selftest.
The test is in the Cocoon block Chaperon samples.
It generates a page which should synchronise with
a demo page on the Cocoon Wiki. However, Cocoon has
since migrated from the Cocoondev.org JSPWiki to the
Apache Wiki using Moin Moin. So the self test is broken.

Does someone else have a JSP Wiki where we could have
this selftest page?

> David, can you commit to cocoon once our changes are ready?

Yes, i can.

-- 
David Crossley


Re: tweaking wiki

Posted by Dave Brondsema <da...@brondsema.net>.
David Crossley wrote:
> Fabio Rinaldi wrote:
>>I believe this grammar is a 'superset' of the original one (with the
>>exception of solving the ambiguity previously mentioned). It should
>>accept all wiki documents accepted by the original grammar.
>>
>>The only different behaviour is that the first "level 3" title (!!! 
>>Title) will be taken as the title of the page (rather than using the
>>name of the file).
>>
>>I have not done any extensive testing though (which would certainly be
>>needed before including in a distribution).
> 
> 
> I "tested" it by looking at the CWiki sample in the seed site.
> 
> The next test was very pleasing. It will now build the
> Apache Incubator website which was breaking before,
> with complaints about heading levels.
> http://marc.theaimsgroup.com/?t=109326766100005
> 
> So i am going to commit it as soon as possible!!!
> 
> Thanks again Fabio, keep on.
> 

I've done some cwiki modifications so I'll try to give a somewhat 
thorough review tomorrow, time permitting.  I'm sure it'll be great 
though, we appreciate the contribution.

We need to keep the chaperon  directory in sync with the block in 
cocoon.  They also asked (last time I made a change) that we update the 
selftest.txt as features change.  David, can you commit to cocoon once 
our changes are ready?

-- 
Dave Brondsema : dave@brondsema.net
http://www.splike.com : programming
http://csx.calvin.edu : student org
http://www.brondsema.net : personal

Re: tweaking wiki

Posted by David Crossley <cr...@apache.org>.
Fabio Rinaldi wrote:
> Nicola Ken Barozzi writes:
> > Fabio Rinaldi wrote:
>  > > One of the possible reasons for this work would be to support an
>  > > alternative wiki format (e.g. MoinMoin Wiki). 
>  > 
>  > Then it's definately of interest :-)
>  > 
>  > You can submit a patch for a .mwiki extension (even partial), and I 
>  > would be happy to apply it.
> 
> I might have a go at it. In the meantime, I'd like to point out a
> possible inconsistency in the current "cwiki" grammar. It looks as if
> the grammar is ambiguous between the two following structures:
<snip/>
> I have rewritten the grammar for cwiki in a (hopefully) unambiguous
> way. Please find it attached, together with the corresponding
> wiki2xdoc.xsl

Thanks. By the way, it is preferable to use the Issue tracker,
but thanks for whatever way you make contributions.

> I believe this grammar is a 'superset' of the original one (with the
> exception of solving the ambiguity previously mentioned). It should
> accept all wiki documents accepted by the original grammar.
> 
> The only different behaviour is that the first "level 3" title (!!! 
> Title) will be taken as the title of the page (rather than using the
> name of the file).
> 
> I have not done any extensive testing though (which would certainly be
> needed before including in a distribution).

I "tested" it by looking at the CWiki sample in the seed site.

The next test was very pleasing. It will now build the
Apache Incubator website which was breaking before,
with complaints about heading levels.
http://marc.theaimsgroup.com/?t=109326766100005

So i am going to commit it as soon as possible!!!

Thanks again Fabio, keep on.

-- 
David Crossley


Re: tweaking wiki

Posted by David Crossley <cr...@apache.org>.
Dave Brondsema wrote:
> Fabio Rinaldi wrote:
> > 
> > The only different behaviour is that the first "level 3" title (!!! 
> > Title) will be taken as the title of the page (rather than using the
> > name of the file).
> 
> Why did you choose to do this?  In all the wiki pages I use, the first 
> title is not the page title, but just a section title.  I think using 
> the file name works better.

Perhaps we had better revert this part of Fabio's fix
and add it to our Issue tracker. It would be nice to
have this configurable, because Fabio's idea works nicely
for the Apache Incubator use case, e.g.
http://incubator.apache.org/projects/altrmi.html

-- 
David Crossley


Re: tweaking wiki

Posted by Dave Brondsema <da...@brondsema.net>.
Fabio Rinaldi wrote:
> 
> The only different behaviour is that the first "level 3" title (!!! 
> Title) will be taken as the title of the page (rather than using the
> name of the file).
> 

Why did you choose to do this?  In all the wiki pages I use, the first 
title is not the page title, but just a section title.  I think using 
the file name works better.

-- 
Dave Brondsema : dave@brondsema.net
http://www.splike.com : programming
http://csx.calvin.edu : student org
http://www.brondsema.net : personal

Re: tweaking wiki

Posted by David Crossley <cr...@apache.org>.
Fabio Rinaldi wrote:
> I have rewritten the grammar for cwiki in a (hopefully) unambiguous
> way. Please find it attached, together with the corresponding
> wiki2xdoc.xsl

Thanks, that is now committed to source control.
Be careful when you do 'svn update' because there
are going to be clashes for you. I needed to fix
some whitespace problems which were introduced by
your text editor. If i did not restore the old
formatting, then we would not have been able to
make sense of your real changes, which are clear now at
http://marc.theaimsgroup.com/?l=forrest-dev&m=109358012500445

-- 
David Crossley


Re: tweaking wiki

Posted by Fabio Rinaldi <ri...@ifi.unizh.ch>.
Nicola Ken Barozzi writes:
 > 'cocoon:/' means: do this request to the current sitemap. Look in the 
 > same file at the bottom for the relevant matches.

OK, found. Thank you. 

 > > One of the possible reasons for this work would be to support an
 > > alternative wiki format (e.g. MoinMoin Wiki). 
 > 
 > Then it's definately of interest :-)
 > 
 > You can submit a patch for a .mwiki extension (even partial), and I 
 > would be happy to apply it.

I might have a go at it. In the meantime, I'd like to point out a
possible inconsistency in the current "cwiki" grammar. It looks as if
the grammar is ambiguous between the two following structures:

section
   para 1
   subsection
       para 2

(where para 2 belongs to the subsection)

section
   para 1
   subsection
   para 2

(where para 2 belongs to the main section)

If I am not mistaken, both structures are accepted by the
grammar. This is (in my view), not correct, as in normal text only the
first structure is valid.

Besides, this ambiguity might cause some errors. For instance, the
following minimal document keeps giving me a parse error:

------------------------------------------------------------
!!! Title 1

!! Title 2

! Title 3

Para 1

# item 1

! Title 4

Para 2
------------------------------------------------------------

I have rewritten the grammar for cwiki in a (hopefully) unambiguous
way. Please find it attached, together with the corresponding
wiki2xdoc.xsl

I believe this grammar is a 'superset' of the original one (with the
exception of solving the ambiguity previously mentioned). It should
accept all wiki documents accepted by the original grammar.

The only different behaviour is that the first "level 3" title (!!! 
Title) will be taken as the title of the page (rather than using the
name of the file).

I have not done any extensive testing though (which would certainly be
needed before including in a distribution).

Best,
Fabio



Re: tweaking wiki

Posted by Nicola Ken Barozzi <ni...@apache.org>.
Fabio Rinaldi wrote:
...
> I started to play a little with the "wiki.grm" file, and
> obtained a couple of interesting things which I would like to
> use (like the "title" for wiki pages that I mentioned in a previous
> message).  
> 
> However I feel that I should not mess up with the default wiki format,
> otherwise things would become uncontrollable as soon as I install a
> new Forrest distribution. 

ATM Forrest is not well equipped for handling extra DTDs and formats, as 
you have found out, but it will get better.

> So my idea is to create a separate "own"
> wiki format, identified by a different file suffix,
> e.g. mydocument.mywiki

If the format is of general interest, we could add it to Forrest itself.

> Then I modified 'forrest.xmap' by duplicating the template that
> matches "*.cwiki", modified the copy so that it matches "*.mywiki",
> then tried to fiddle with the template so that I can make use of my
> own versions of "wiki.gram" and "wiki2xdoc.xsl". For the latter, it is
> easy, as it is explicitly pointed to in the template. However, I
> do not know how to point 'forrest.xmap' to my own version of
> "wiki.gram". It seems to make use of a cocoon identifier
> "cocoon:/wiki.xgrm". Can this be customized? 

'cocoon:/' means: do this request to the current sitemap. Look in the 
same file at the bottom for the relevant matches.

> One of the possible reasons for this work would be to support an
> alternative wiki format (e.g. MoinMoin Wiki). 

Then it's definately of interest :-)

You can submit a patch for a .mwiki extension (even partial), and I 
would be happy to apply it.

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------