[Pmwiki-users] %class=something% (was Re: Extending ...)

Patrick R. Michaud pmichaud
Mon Mar 1 19:06:53 CST 2004


On Tue, Mar 02, 2004 at 12:48:21PM +1100, Nathan Jones wrote:
> Pm wrote:
> 
> True, but the beauty of having a markup specifically for assigning
> classes is that you don't have to define a markup every time you add a
> class. Have you seen Richard's post (Subject: Span and Div) suggesting
> [[div]]?

Sure, I even proposed it myself in an earlier post, and for some reason 
I'm not completely comfortable with that approach.  I'd like to have a
[[div]] markup that is less obtrusive.  But I can go ahead and implement 
[[div]] if there's sufficient demand for it (send me "yes" or "no" votes 
via email).

> >   $InlineReplacements['/^=note (.*)$/'] = "<div class='note'>$1</div>";
> 
> I guess it would be possible to expand this to recognise =class-foo:
> 
> $InlineReplacements['/^=class-([a-zA-Z]*) (.*)$/'] = "<div
> class='$1'>$2</div>";

If doing this I'd recommend

    $InlineReplacements['/^=class:([a-zA-Z][-\\w]) (.*)$/'] =
      "<div class='$1'>$2</div>";

so that digits, hyphens, and underscores are allowed in class names.
But I'd still like to have a wikistyle method for block styles.

Pm



More information about the pmwiki-users mailing list