[Pmwiki-users] PmWiki WikiStyles implementation testers needed

Patrick R. Michaud pmichaud at sci.tamucc.edu
Fri Feb 14 11:12:44 CST 2003

On Fri, 14 Feb 2003, Jonathan Scott Duff wrote:

> . It appears that style definitions must come lexicographically before
> their use.  True?

True.  PmWiki processes items top-to-bottom in a procedural form (like
a one-pass compiler), and not full text in a declarative form.

> . Why does %foo bar baz% not render, but but %don't render this% does?

The rule for recognizing a WikiStyle is that the only characters
allowed in the %...% are letters, numbers, underscores, hyphens, commas,
pound-signs, equals-signs, and whitespace.  (For you regexp types, the 
pattern is /%[-,=#\w\s]*%/.)  The point was to try to prevent an accidenal
line containing two %-signs as normal text from being treated as a style 
sheet.  So, %foo bar baz% is a WikiStyle meaning to combine the
"foo", "bar", and "baz" defined styles, while "%don't render this%" isn't
a valid WikiStyle because it contains the apostrophe.

However, I know this still isn't quite perfect, because text like
"John scored 15% and Mary scored 30%" would treat the parts between
the two percent signs as being a style sheet.  So it doesn't quite work.

Some possible solutions:
  * Require everything in a WikiStyle to be in the form [name]=[value].
    Then %=red% would mean to use the previous WikiStyle that had "define=red"
    in it.
  * Require that the first character following the leading % in a WikiStyle
    be a letter.  This would eliminate the mis-classifications that occur in
        - John scored 15% and Mary scored 30% on the exam
        - Our output increased by 15%-30%
  * Other ideas?

One possible benefit of the WikiStyle implementation I thought of (based
on Scott's experiments) is that some people have asked for the ability 
to include comments in the markup that do not render on output.  
I could easily add a "comment" WikiStyle such that

   This is %comment% an undisplayed comment and %% some text.

would render as

   This is some text.


More information about the pmwiki-users mailing list