On Donnerstag, 6. August 2009, jeroen De Dauw wrote:
> Hey guys,
>
> I have a parser function named display_points. It accepts a parameter
> 'points', like this:
>
> #display_points:points=55.7557860, 37.6176330; 1,1; 12,34
>
> Obviously, ';' is the separator between coordinate pairs.
>
> Now I want to allow people to specify 2 additional parameter for each
> coordinate pair: title and label. I'm not sure what's the best syntax for
> this. This is what I currently have in mind, but it's not ideal, since this
> does not allow ';' or '-' in the title and label:
>
> #display_points:points=55.7557860, 37.6176330-title-label; 1,1-title; 12,34
>
>
> Does anybody have a suggestion on how to do this better?

My first suggestion would be to use MediaWiki symbols for separating multiple 
inputs, e.g. 

{{#display_points:points=55.7557860; 37.6176330 | 1; 1 | 12; 34 }}

This lets you use ";" as a separator between components of a pair, which will 
be helpful for internationalization (Germans have an odd convention of using 
"," instead of "." as a decimal separator, so your current notation looked 
rather confusing to Germans).

As a next step, you could allow further named parameters after a coordinate 
pair to specify more information, e.g.

{{#display_points:points=55.7557860; 37.6176330 | title=foo | 1; 1 | label=bar 
| 12; 34}}

The "parameter=value" style is something users are familiar with.

-- Markus

>
>
> Cheers,
> Jeroen De Dauw
>
>
> Forum: code.bn2vs.com
> Blog: blog.bn2vs.com
>
> Skype: rts.bn.vs  ; Xfire: bn2vs
>
> Don't panic. Don't be evil.
> 70 72 6F 67 72 61 6D 6D 69 6E 67 20 34 20 6C 69 66 65!


-- 
Markus Krötzsch
Semantic MediaWiki    http://semantic-mediawiki.org
http://korrekt.org    mar...@semantic-mediawiki.org


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to