[Pmwiki-users] Re: AsSpaced function (was pmwiki-2.0.devel9 released)
Pierre Rouzeau
pierre
Wed Oct 13 16:29:33 CDT 2004
Hello,
I find the use of @Names a very interesting idea, and this is very well
argumented.
In addition, for non english keyboards, brackets links are difficult to
type, and this
alternative is even more interesting for non-english keyboard users.
The question will be, if you choose this way, what about compatibility
with other Wikis ?.
Anyway, here is a solution to use that kind of links in PmWiki :
(you can see a test here http://www.rouzeau.net/w3)
## @"free link" or @'free link's or @"yop'la boum"
Markup('@_','links',"/@([\\x22\\x27])(.+?)\\1($SuffixPattern)/e",
"Keep(MakeLink(\$pagename,PSS('$2'),NULL,'$3'),'L')");
## @"target | text" or @'target , text' or @"other target; a'text"
Markup('@|','<[[',"/@([\\x22\\x27])([^|,;\\1]+)[|,;](.*?)\\s*\\1($SuffixPattern)/e",
"Keep(MakeLink(\$pagename,PSS('$2'),PSS('$3'),'$4'),'L')");
## @link (after a non alphanum char)
Markup('@','links',"/([^[:alnum:]])@($SuffixPattern)/e",
"Keep(MakeLink(\$pagename,PSS('$2'),PSS('$1$2'), NULL),'L')");
## @link (at line beginning)
Markup('@2','links',"/^@($SuffixPattern)/e",
"Keep(MakeLink(\$pagename,PSS('$1'),NULL, NULL),'L')");
As for now, the drawbacks of hereabove code i've yet seen:
- It shall be installed in the script 'stdmarkup.php', don't work from
'config.php'
- With the direct @Names link, the character before the link is shown
as being part of the link, but this is only cosmetic.
- Links @Group.Name or @Group/Name don't work, you need to set quotes
like @"Group.Names". Anyway, there is probably a solution...
These are my very first regular expression, so there might be some room
for improvement... And what about performance ?
If you have comments or find others failures, don't hesitate...
Maybe the use of parenthesis instead of quotes ? (or in alternative).
Regards
Fred Chittenden wrote:
>>.. WikiWords seems to cause more problems than they are worth.>
>>
>>
>
>I've had similar issues with WikiWords.
>
>In a pre-internet language system I worked with, the equivalent of
>WikiWords were formated @WikiWord to signify it was a page "at" another
>location -- @Page
>
>* The @Page convention is very intuitive and easy to use. No closing
>deliminter is necessary for page names except @"Page Name" (pages with
>spaces). That simple exception is also intuitive and easy to type.
>** @Page conventions were relatively easy for a programmer to parse.
>** The use of @ as a deliminter is easy to find when editing a page.
>There's no hunting for hidden WikiWords lurking in the text...
>** An @Page parsing exception would seem to be email addresses. However,
>email addresses can be parsed out by always having a "nonspace" character
>proceeding @Page.
>* The @Page convention eliminates any possible confusion with capitalized
>non-wikiwords.
>* @Group/Subgroup/Page convention works fine.
>* Undeveloped (new or unfound) @Page references could be displayed as @Page
>in a highlighted or underlined format, or whatever wiki format one wishes
>to use.
>* Future expansion of the 'language' can be easily provided by recognition
>of a secondary delimitor following the @ delimiter.
>** This would seem to be another way to define directive delimintors.
>*** Whether or not the secondary delimitor is |, ((, *, or !, it's unlikely
>to be confused with normal text markup.
>**** One could easily provide customizable choose of delimitors in the
>config file as well as 'on the fly'. .
>** Variable link possibilities could be provided by expanding the @Page
>convention to allow for @<function> or @<procedure>. (using <> as
>delimitors)
>** One could have @<Page Function> which is evaluated and displays a
>variable page link depending upon the value of <Page Function>.
>** One could use @<Function> to display or act on the result of the
><function>.
>** @<Procedure> could offer a means to provide access to all sorts of
>procedures (like get input, include a blog, etc.).
>***These function and procedure calls could be interpreted wikicode within
>the delimintors, code from another WikiPage, or php code from some php
>file, etc.
>
> Of course this sort of convention and power is probably all beyond
>contemporary, albeit developing, wiki standards... I provide these sorts
>of examples from the perpective of someone who's been there and done that
>with an interpreted language system whose original intent was quite similar
>to wiki -- a simple markup language for creating all sorts of interactive
>enduser applications.
>
>
>
Page principale - Main page - www.rouzeau.net <http://www.rouzeau.net>
---------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/pmwiki-users_pmichaud.com/attachments/20041014/1b764318/attachment.htm
More information about the pmwiki-users
mailing list