Forum OpenACS Development: Re: Re: Wiki modifications for mediawiki format

Collapse
Posted by Brian Chapados on
I realize that includes {{...}} are indeed more flexible/powerful for integrating and rendering different types of content. Clearly, [[page|label]] could be short for {{link page -label "label"}}. As soon as I saw the demo page, I knew you had nailed the problem.

What I'm having a hard time wrapping my head around is whether the {{...}} syntax provides an easy way to relate the included item to the wiki page. There will certainly be cases where you don't need that functionality, but if you want to render a different type of cr_item, such as an image, it would be nice to have a way to setup a cr_relationship between the page and the image. I noticed that you're using an xowiki_references table to store page references. In the wiki package, Dave B. created cr_item relationships to do this. I'm not sure which way is better, but xowiki seems to be more robust in terms of handling page references right now.

Anyway, my point is that the link [[...]] construct implies a relationship between the page and the linked item, thus using the [[image:myimage.jpg]] might be a convenient way to achieve this. Your code for handling references already supports a link_type attribute. Using [[linktype:item_name|options]] can be implemented so that it ultimately resolves to {{adp /adp/stub/for/linktype item_name -options options}} to generate HTML for the item. The difference would be that the [[...]] construct creates a relationship. Alternatively, I suppose you could just add a -link or -relate option to the {{adp ...}} syntax, which would do the same thing.

Also, I have mixed feelings about WYSIWYG editors. I understand that people like them, however, for composing anything other than simple documents, I find them annoying. I especially hate them for any application where you need to insert several graphics into a document. I use latex when possible to write papers/protocols/technical documents, ect.. So, I like the idea of the xowiki supporting some type of _optional_ text markup system. I'm guessing that there might be others (though maybe a small percentage) that feel the same way. It occurred to me that much of the formatting for mediawiki (or any wiki really) could be handled by a proc such as:

ad_html_text_convert -from text/wiki

We could just add support for a text/wiki type. It would render everything except links [[...]], includes {{...}} and div >>...<< markups. This might be the best way to add support for using wiki markup in xowiki.