[Pmwiki-users] Markup

Patrick R. Michaud pmichaud
Wed Aug 27 15:34:28 CDT 2003


On Wed, Aug 27, 2003 at 05:50:45PM -0300, Pedro Miller Rabinovitch wrote:
> 
> Why does markup have to be Wiki-specific? Or even site-specific?
> 
> The same way we have "user-set templates", why can't we have "user-set 
> markup"? Users would be able to choose between {{Link}} or [Link] or whatever 
> it is they'd rather do. *bold* or '''bold'''. _italics_ or ''italics''. It's 
> pretty easy, when you think about it -- we either keep the server-side 
> version in a different, specialized storage format (e.g., XML, whatever) or 
> convert different input markup into the local flavor.

It's only easy as long as you're able to come up with a reliable translation
to convert from the specialized storage format back to a readable markup--
i.e., you need a *bidirectional* translator that can preserve all of the
markup semantics.  The need for bidirectional translation is the tough part--
although it's relatively easy to create a translator that goes from A to B,
in most contexts it's very difficult to come up with a reverse-translator
that can reliably go from B back to A.  

Example 1:  Save a Word document as HTML, then load the HTML document back
into Word.  The document doesn't look the same because the translations
are imperfect.

It might be possible in wiki environments, where the markup language is
somewhat limited, but even here there can be some problems.

Example 2:  User A prefers {{Link}} for links, while user B prefers "[Link]".
How does A write "[Link]" in her text --i.e., the word "Link" in brackets
but is not a link?  Does she have to write [=[Link]=], and if so, how is
she supposed to know that she needs to escape the single brackets, since
single brackets don't have any special meaning in her custom flavor?  Does
the specialized storage format have to go ahead and convert her "[Link]"
to some sort of internal representation, even though it has no special
meaning in her markup, so that it doesn't suddenly become treated like 
a link when B starts editing the pages she wrote?  

It becomes even more difficult in systems where the languages can be
customized (as PmWiki's markup language is customizable)--there has
to be a way to add the customizations (and their reverses) into the 
specialized storage format.

So, I don't think it'd be all that easy to do.  However, if it's done
I think that clearly one ought to use an XML-like structure for the 
internal format--the trick is to coming up with a system that can 
reliably perform translations between an XML internal representation, 
various custom wiki markups, and XHTML.  The complexity comes into
play because the wiki markup translator has to be able to simultaneously
handle all of the available wiki markups in all documents, and not just the
subset in use by any particular user.  

Pm



More information about the pmwiki-users mailing list