[pmwiki-users] Divisions, IDs and Styles

Patrick R. Michaud pmichaud at pobox.com
Thu Aug 10 15:13:00 CDT 2006


On Thu, Aug 10, 2006 at 06:34:48PM +0100, Hans wrote:
> I was playing around with the new division nesting feature,
> trying to create a hidden treelike structure
> (see example at http://www.pmwiki.org/wiki/Cookbook/ShowHide)
> and have  a few questions regards divisions:
> 
> 1. Do the new (:div1:)  (:div1end:) etc directives also apply to
> >>div1<< >>div1end<< or not?

The markup ">>foo<<"  is not the same as (:foo:), it's the same as
"(:div:) %foo div%".  Thus, the markup ">>div1<<" isn't the same
as (:div1:), it's the same as "(:div:) %div1 div%".  

> 2. As div1 div2 etc gets used as a div identifier internally for
> pmwiki, can it please be extended to be used as the div's id, if no id
> is provided?
> So (:div3:) is the same as (:div3 id=div3:), but (:div3 id=somediv:)
> has id=somediv, not div3.
> This would make it a lot simpler to build nested menus etc, shortening
> the markup code.

Possibly, but I'm not sure I want to do it that way.  It certainly
wouldn't be difficult to create a local custom markup rule that 
does this.

> 3. Can I mix freely (:div1:) and >>div<< type divisions?

Yes, but keep in mind that closing a division will close any nested
division.

> 4. (:div:) and >>div<< take a different approach to applying styles.
> (:div:) needs (:div style='[css style definitions]':), but
> >>div<< needs >>div [wiki style definition] [wiki style definition] ...<<
> Could that be unified somehow, to allow wiki style definitions inside
> (:div ...:)?

PmWiki never uses wikistyle definitions inside of (:...:) directives,
I wouldn't want to start with (:div:).  The way to get a wikistyle
definition applied to a (:div:) is to do:

    (:div:) %wikistyle div%

Similarly, one can do the following to apply a wikistyle to a div1 with:

    (:div1:) %wikistyle div%


Of course, as mentioned in a previous email, I'm still considering the
use of multiple angle-brackets for div1, div2, so that we'd have

    >>foo<<             same as   (:div:) %foo div%
    >>>bar<<<           same as   (:div1:) %bar div%
    >>>>baz<<<<         same as   (:div2:) %baz div%

Pm




More information about the pmwiki-users mailing list