[pmwiki-users] nesting divs and tables

Patrick R. Michaud pmichaud at pobox.com
Sat Aug 5 10:30:39 CDT 2006

On Sat, Aug 05, 2006 at 08:53:13AM -0400, Pico wrote:
> Patrick R. Michaud wrote:
> >I'm experimenting with a feature on pmwiki.org to allow nesting
> >(:table:) within (:div:), (:div:) within (:table:), and divs
> >within divs.  (Nesting of table directives still isn't supported.)
> >
> >See http://www.pmwiki.org/wiki/Test/NestTableAndDiv for some samples.
> >
> >Also, out of curiosity, is there anyone who is likely to be
> >negatively impacted by this change?  Since nesting hasn't been
> >allowed until now, the only case I can imagine that might cause 
> >a problem is where an author has relied on (:table:)/(:cell:) 
> >to automatically close a >>div<</(:div:) and vice-versa.  But
> >I can't imagine that this is at all common (and, of course,
> >it's easily fixed when it does occur).
> >
> I would think that consecutive divs might be more common.  As you said, 
> that could be easily fixed, but I wonder whether the difficulty may lie 
> in diagnosing what has happened (would the result always be fairly 
> obvious, or would it be subtle)

Consecutive divs aren't really an issue, as that continues to work as it did
before -- i.e., starting a new div with >>xyz<< or (:div:) automatically
closes the previous one.

Currently the way to get a nested div is to add digits after the "div" to
distinguish it from others div, as in (:div1:), (:div2:), (:div3:), etc.

    Here's a div
    A div nested within the 'xyz' div.
    A second div nested within 'xyz', auto-closing the previous "div1"
    Back in the 'xyz' div.

The digits don't have any significance outside of distinguishing
divs -- i.e., a "div1" can nest inside of a "div2" and vice-versa.

I'm thinking of extending this so that letters can also be used to 
identify the new nesting level -- i.e., (:divz:), (:divxyz:), etc.,
each of which would have corresponding (:divzend:), (:divxyzend:), etc.
tags.  The downside is that it might conflict with any other use of "div"
as the first letters of a directive name.


More information about the pmwiki-users mailing list