The mail below was forwarded to me. I'll put it online, will refactor it later
-- ChristophSauer, 2008-Mai-06 13:41 (CEST)
> Hi, > > I edit at Wikipedia, where I'm a long standing user with a lot of > experience of the markup and its few limitations. I have to say, very > nice work on Creole - I'll be watching it. > > I have a couple of suggestions for markup that are limitations in > MediaWiki, perhaps simple to provide in Creole, to consider. What the > mediawiki software designers call "magic words" - that is, data > substituted at edit time (~~~~ as signature, ~~~~~ as date) or at > render time (so-called {{MAGICWORDS}} ) are poorly provided in the syntax. > > Without complicating, may I suggest a structure in the creole schema > to handle "such arbitrary words as the wiki designer/creole user > might wish to create"? > > Syntax would be a single char prefix , hence <char><a-z><non-a-z > terminator> > > For example: > > ~date ~sig ~serverload ~sitemanager ~myname ~arbitraryword > > ~~date would then render as "~date" > > Without formally defining any "expected" words in the markup, the > existence of a structure by which a creole user could add their own > arbitrary words to the syntax would be nice. > > This is a significant item missing from the current specification, > when I look over it. > > > PRACTICAL IMPLEMENTATION: > > A wiki designer using creole provides a means for the creole renderer > to get a value for an arbitrary "word". For example: foo (word, > is_saving) > > Is_saving is a Boolean flag whether the value is being sought because > an edit is being saved (1) or because markup is being rendered (0). > Such words are replaced with whatever foo() returns, prior to other > rendering operations. > > Example: > > Foo ("name", ?) returns the name of the logged in user. So saving a > text of the form "blah. ~sig" will be replaced by "blah. <username>" before saving. > > Foo ("numberofpages",1) is replaced by "~numberofpages" and foo > ("numberofpages",0) replaced by a count of the number of pages. So on > saving the word is preserved, and on rendering is replaced by a page count. > > Foo ("sitemanageraddress",1) is replaced by "~ sitemanageraddress" > and foo > ("sitemanageraddress",0) replaced by a fixed string "johndoe@gmail.com" > which is modified when the current site manager address changes. On > saving the ~ sitemanageraddress is preserved, and on rendering > replaced by the correct current email address. > > Best, > > FT2
For "magic words" that are processed at render-time, I would suggest to use the same syntax as for macros (whatever that may be) like <<CurrentDate>>. Effectively, these just become macros, there is no need for a separate syntax.
For "magic words" that are processed at save-time, a character could be added in front, e.g. ~<<CurrentDate>>. Reusing the escape character (tilde) here would degrade nicely if, for some reason, save-time processing didn't happen (i.e., it would just render as "<<CurrentDate>>").
If angle brackets were not used for the save-time case, (i.e, ~CurrentDate instead of ~<<CurrentDate>>), there would be no easy way to include arguments like ~<<CurrentTime format='yyyy.MM.dd'>>.
-- StephenDay, 2008-Mai-13
Tilde is already the escape character. Plugin syntax would be the most obvious choice (something like <<sig>>).
-- YvesPiguet, 2008-May-19
Problem with Plugins is that they always create content at runtime (per page view) in the context of the current user. So if you would write a plugin in JSPWiki named <<Sig>> it could always only replace the current user logged in. Clearly not what was intended. In JSPWiki the magic word "Signature" was implemented by a filter, replacing a markup at translation time. It replaces exactly the two minus and 4 tildes. So we have to distinguish from an technical point of view between
- Always at runtime -> plugins, create content dynamically (like portlets in portal software)
- Pre Translate -> filter
- Translate -> parser
- Post Translate -> filter
I don't have a clear picture yet how to categorize them more clearly to fit for all engines and converters. But because of the "pretranslate" of the magic words, the tildes where no problem to implement in JSPWiki, except that you have to avoid to pretranslate them if they are put into a nowiki block.
--~~~~
I would therefore suggest that we prefix a magic word something, e. g. two dashes.
-- ChristophSauer, 2008-Mai-24 10:01 (CEST)