[Pmwiki-users] %class=something% (was Re: Extending ...)
Greg Morgan
Cybie
Mon Mar 1 12:52:34 CST 2004
> -----Original Message-----
> From: Pmwiki-users-bounces at pmichaud.com
> [mailto:Pmwiki-users-bounces at pmichaud.com] On Behalf Of
> Richard Canning
> Sent: Sunday, February 29, 2004 7:09 PM
> To: pmwiki-users at pmichaud.com
> Subject: RE: [Pmwiki-users] %class=something% (was Re: Extending ...)
>
> Well, I want block text styles, but I don't think I want them
> bad enough to jump up and down screaming about it.
>
> Some specific markup that will add <span class=xxx> </span>
> and <div class=xxx> </div> would really really really (I
> think three reallys is enough) make PmWiki great. What I have
> read on the list seems to indicate that there are ways of
> doing it, rather than a specific way that is coded in that is
> how it "should" be done. I would like some official markup so
> I know it is not going to break.
I know what you mean. I've got a bit of a hack installed in my config.php
file for use on my personal wiki. But when/if an offical span/div tag gets
released it's going to break.
In case you're curious, here's what I've got in my config.php
$InlineReplacements["/\\[D\\~\\~D\\]/"] = "</div>";
$InlineReplacements["/\\[D\\~(.*?)\\~D\\]/"] = "<div class='$1'>";
$InlineReplacements["/\\[S\\~\\~S\\]/"] = "</span>";
$InlineReplacements["/\\[S\\~(.*?)\\~S\\]/"] = "<span class='$1'>";
This adds the markup [D~class~D] for divs and [S~class~S] for spans.
Example:
[D~foo~D]
Here's some text.
[D~~D]
This comes out as
<div class='foo'>
Here's some text.
</div>
The only problem with this method is that it doesn't automatically close the
spans and divs like the advanced table markups do.
I think to add that kind of functionality we'd need to be able to
extend/replace the PrintText function.
More information about the pmwiki-users
mailing list