[pmwiki-users] preformatted text block *with* formatting? (bug in [@..@] ?)

Patrick R. Michaud pmichaud at pobox.com
Thu May 25 16:31:23 CDT 2006

On Thu, May 25, 2006 at 01:59:43PM -0700, Jo Rhett wrote:
> On Thu, May 25, 2006 at 03:51:27PM -0500, Patrick R. Michaud wrote:
> > That's a WikiStyle.  Define your local css class, and then use
> > 
> >    %example% text %%
> > 
> > to produce  <span class='example'> text </span> .
> > 
> > (Note that WikiStyles can do much more than just CSS, but that's the
> > basic approach for CSS.)
> Okay, that's hella easy.  But now I'm confused.  I had read more or less
> this on 
> http://www.pmwiki.org/wiki/PmWiki/CustomWikiStyles
> But this page says you have to modify the config.php for each style and
> other stuff that made me just shake my head and look farther.

Agreed, the WikiStyles documentation is some of the least complete and
needs a lot of work.  It has been that way for some time.

The general problem (if we can call it a "problem") is that in
PmWiki there are often many different ways to achieve a desired
effect, but sometimes the documentation only describes one of those
ways (and *that* depends on who wrote the documentation).

As many people on the mailing list can attest, for any given
request I'm often able to describe at least two or three ways
it can be handled within PmWiki.  That's good from a "flexibility
and power of PmWiki" perspective, but it also makes writing clear
documentation (in the absence of a specific request) very difficult.  :-)

> Also, after using your >>pre<< syntax I realized that this generates
> <div class="pre">
> which is exactly what I want.

Yes.  What is really happening here is that any undefined WikiStyle
is automatically treated as a request for a class, thus by 
default >>pre<< and %pre% are the same as saying "class=pre".

In reality, a markup like >>pre<< becomes

    (:div:) %div pre%

which essentially becomes

    (:div:) %apply=div class=pre%

which says to create a new <div> section, and then apply a class='pre'
attribute to it.  (The %div% wikistyle is predefined as "apply=div".)

> In short, it seems that many things are much easier than they seem from the
> documentation.  I'll do some testing and then see if I can simply those
> pages a bit and put the config.php stuff farther done and properly marked
> as optional.

That would be excellent!


More information about the pmwiki-users mailing list