(anonymous guest) (logged out)

Copyright (C) by the contributors. Some rights reserved, license BY-SA.

Sponsored by the Wiki Symposium and the Nuveon GmbH.

This is version . It is not the current version, and thus it cannot be edited.
[Back to current version]   [Restore this version]

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.

-- StephenDay, 2008-Mai-13

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.
>  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

Add new attachment

Only authorized users are allowed to upload new attachments.

« This particular version was published on 13-Mai-2008 19:41 by StephenDay.