[Pmwiki-users] The reason I want a class setting that works over multiple paragraphs.

Patrick R. Michaud pmichaud
Tue Mar 2 19:46:28 CST 2004


On Wed, Mar 03, 2004 at 01:07:04PM +1100, Richard Canning wrote:
> Currently, so that we can see who wrote what comment, we use a table to change the background of a section of paragraphs so we can easily see by what colour is used, who wrote it.
> 
> Eg:
>    [[table width='100%' cellspacing='0' cellpadding='0']]
>    [[cell bgcolor='#ffe5da']]
> 
>    Insert text here
> 
>    [[tableend]]
> 
> 
> Now this is not very good for a number of reasons.
> 1) It does not print well.
> 2) It makes the pages look too busy.
> 3) It is awkward to do.
> 
> What we want to be able to do is use something like.
>    [[div richard]]
>    Insert text here
>    [[divend]]

Oh, I don't have *any* problem with a [[div]]...[[divend]] syntax as
proposed here, and I fully intend to add it in a short-term release
of PmWiki.  My dilemma is that I feel there also needs to be another
form of block-based styling, and that they need to be introduced at
the same time or else a lot of people will begin building kludge
workarounds based on the fact that [[div]] is the only available markup.

So, [[div]]...[[divend]] will show up soon, but I feel a need to 
consider it within a larger context at the moment.

Also, would it be okay if the div markup uses [[div class=richard]]
instead of [[div richard]], to maintain consistency with the way the
[[table...]] and [[cell...]] markups work?


Pm

P.S.:  If you're wanting to experiment and play a little (and so I can show
off a bit more), note that I think it would be possible to implement 
something like the markup you're requesting within the *current* version of 
PmWiki, although it's not immediately obvious.  Add to your config.php

   $DoubleBrackets['/^\\[\\[author (.*)\\]\\]/'] =
     "[[cellnr class='$1' width='100%']]";
   $DoubleBrackets['/^\\[\\[authorend\\]\\]/'] = "[[tableend]]";

and this will enable the markups [[author <name>]] and [[authorend]] in 
your system.  The [[author <name>]] will be converted into a table
cell (one cell per row) with a class='<name>' attribute.  Note that
the [[table ...]] markup isn't needed since it doesn't actually generate
a table.  All that [[table ...]] does is close off any existing table,
and define the attributes to be used in the <table ...> tag created by
the next [[cell]] or [[cellnr]] markup.

And, of course, when PmWiki does come out with [[div]] markup in the very
near future, you'll be able to easily convert the above to turn things into 
[[div class='$1']] and [[divend]].




More information about the pmwiki-users mailing list