Mailing List Archive

Suggested changes to wiki plugin
Hi all,

I needed to fix some bugs (or missing features) in the wiki plugin, to better cope with the jspwiki format. So far I have only stored the changes locally in my project folder (thus the previous commit to fix the locationmap for finding resource files). Now I would like to move the changes to the plugin, but there are one change that I would like feedback on before I do this.

The changes I have made are these:

* I added support for formatting and links within table cells, so that tables now should behave as the jspwiki spec [1] says
* I added support for definition lists (terms + definition), but *NOT* in accordance with the jspwiki spec

The reason for not following the spec was that I could not get the Chaperon grammar (which is used to parse the jspwiki document and convert it to xml) to accept the syntax used by jspwiki. I don't know why, but to me it looks like a bug in the Chaperon lexer.

The jspwiki syntax is:

; Term : definition

My syntax is:

#; Term
##: definition

Not as elegant, but it works, and my implementation allows for links, formatting and breaks within the definition (which should be in accordance with the jspwiki syntax).

Now the question(s):

* is it ok with you if I commit these changes, even though one is with a different syntax than expected? I will of course update the documentation accordingly
* it is said in the wiki plugin docs that we should keep the sources in sync with the Cocoon 2.1 block - but does that even apply for the syntax-breaking changes?

Best regards,
Sjur

[1] http://www.jspwiki.org/wiki/TextFormattingRules
Re: Suggested changes to wiki plugin [ In reply to ]
Sjur Moshagen wrote:
> Hi all,
>
> I needed to fix some bugs (or missing features) in the wiki plugin, to better cope with the jspwiki format. So far I have only stored the changes locally in my project folder (thus the previous commit to fix the locationmap for finding resource files). Now I would like to move the changes to the plugin, but there are one change that I would like feedback on before I do this.
>
> The changes I have made are these:
>
> * I added support for formatting and links within table cells, so that tables now should behave as the jspwiki spec [1] says
> * I added support for definition lists (terms + definition), but *NOT* in accordance with the jspwiki spec
>
> The reason for not following the spec was that I could not get the Chaperon grammar (which is used to parse the jspwiki document and convert it to xml) to accept the syntax used by jspwiki. I don't know why, but to me it looks like a bug in the Chaperon lexer.
>
> The jspwiki syntax is:
>
> ; Term : definition

I wonder if it is the "space" characters. The reference [1] shows no spaces.

> My syntax is:
>
> #; Term
> ##: definition
>
> Not as elegant, but it works, and my implementation allows for links, formatting and breaks within the definition (which should be in accordance with the jspwiki syntax).
>
> Now the question(s):
>
> * is it ok with you if I commit these changes, even though one is with a different syntax than expected? I will of course update the documentation accordingly

I reckon that it is fine to add whatever solution enables it to work for you.
We can always issue a new version of the plugin later that fixes it differently.

> * it is said in the wiki plugin docs that we should keep the sources in sync with the Cocoon 2.1 block - but does that even apply for the syntax-breaking changes?

I reckon so. There is not enough activity to warrant separate versions.

-David

> Best regards,
> Sjur
>
> [1] http://www.jspwiki.org/wiki/TextFormattingRules
>
Re: Suggested changes to wiki plugin [ In reply to ]
Den 17. jan 2013 kl. 02:08 skrev David Crossley:

> Sjur Moshagen wrote:
>> * I added support for definition lists (terms + definition), but *NOT* in accordance with the jspwiki spec
>>
>> The reason for not following the spec was that I could not get the Chaperon grammar (which is used to parse the jspwiki document and convert it to xml) to accept the syntax used by jspwiki. I don't know why, but to me it looks like a bug in the Chaperon lexer.
>>
>> The jspwiki syntax is:
>>
>> ; Term : definition
>
> I wonder if it is the "space" characters. The reference [1] shows no spaces.

It turned out to be a missing feature in the grammar. I have now implemented it, and it behaves as expected. I had to both tinker a bit with the grammar, and resolve some abiguity afterwards in the xsl processing (it is impossible for the tokeniser to know that a ':' at the end of a word is *not* a term definition separator, so I had to reconnect it to the preceding text if it was not inside an already established definition list).

Thanks for following up, it inspired me to try once more, and that fixed it :)

>> * it is said in the wiki plugin docs that we should keep the sources in sync with the Cocoon 2.1 block - but does that even apply for the syntax-breaking changes?
>
> I reckon so. There is not enough activity to warrant separate versions.

Ok, I will do that soon.

Sjur
Re: Suggested changes to wiki plugin [ In reply to ]
Sjur Moshagen wrote:
> skrev David Crossley:
> > Sjur Moshagen wrote:
> >>
> >> * I added support for definition lists (terms + definition), but *NOT* in accordance with the jspwiki spec
> >>
> >> The reason for not following the spec was that I could not get the Chaperon grammar (which is used to parse the jspwiki document and convert it to xml) to accept the syntax used by jspwiki. I don't know why, but to me it looks like a bug in the Chaperon lexer.
> >>
> >> The jspwiki syntax is:
> >>
> >> ; Term : definition
> >
> > I wonder if it is the "space" characters. The reference [1] shows no spaces.
>
> It turned out to be a missing feature in the grammar. I have now implemented it, and it behaves as expected. I had to both tinker a bit with the grammar, and resolve some abiguity afterwards in the xsl processing (it is impossible for the tokeniser to know that a ':' at the end of a word is *not* a term definition separator, so I had to reconnect it to the preceding text if it was not inside an already established definition list).
>
> Thanks for following up, it inspired me to try once more, and that fixed it :)

Nice. The power of open source development.

Last night i was just about to help with the deployment
issue, when you managed to fix it. Great.

-David

> >> * it is said in the wiki plugin docs that we should keep the sources in sync with the Cocoon 2.1 block - but does that even apply for the syntax-breaking changes?
> >
> > I reckon so. There is not enough activity to warrant separate versions.
>
> Ok, I will do that soon.
>
> Sjur
>