[pmwiki-users] Divisions and nesting

Patrick R. Michaud pmichaud at pobox.com
Wed Apr 11 13:13:38 CDT 2007

On Wed, Apr 11, 2007 at 06:52:27PM +0100, Hans wrote:
> Where do I read up on nesting of divisions using div markup?

Right here.  (I don't think there's a good documentation page for
it yet.)

In addition to the normal (:div:)...(:divend:), one can also
suffix "div" with a number to indicate a specific div to be
opened or closed.  For example (indentation shown for clarity):

    (:div:)           <div>                start a new div
    abc                 <p>abc</p>
    (:div1:)            <div>              start a (nested) div1
    def                   <p>def</p>
    (:div1:)            </div><div>        close prev div1, start new div1
    ghi                   <p>ghi</p>
    (:div1end:)         </div>             close prev div1
    jkl                 <p>jkl</p>
    (:divend:)        </div>               close div

Any sequence of digits can be used to distinguish one div from another.
The digits don't imply any sort of ordering relationship -- they're
simply used to match up opening and closing div tags.  For example,
the following all output the same results:

    (:div1:)            (:div3:)          (:div2:)
    (:div2:)            (:div2:)          (:div1:)
    (:div3:)            (:div1:)          (:div3:)
       text                text              text
    (:div3end:)         (:div1end:)       (:div3end:)
    (:div2end:)         (:div2end:)       (:div1end:)
    (:div1end:)         (:div3end:)       (:div2end:)
Closing a div automatically closes any nested divs that were started
inside of it.

In February Feral came up with some excellent ideas about 
improving the >>...<< markup to better incorporate nested
divs, and I started a thread [1] with some more ideas
based on Feral's proposal, but there didn't seem to be a
clear consensus on a choice.  Now would be a really good
time to bring it back up again.

Essentially, the idea is to augment the >>...<< markup to
correspond to the nested divs.  My original idea was to
increase the number of >>'s to separate divs, thus:

    >>...<<             (:div:)
    >>>...<<<           (:div1:)
    >>>>...<<<<         (:div2:)

Feral's original proposal was to simply preface the brackets 
with digits:

    >>...<<             (:div:)
    1>>...<<            (:div1:)
    2>>...<<            (:div2:)

I also proposed that digits could go on the inside of the brackets:

    >>1 ...<<            (:div1:)
    >>2 ...<<            (:div2:)

I highly recommend following the mailing list thread.  If we need
to create a vote page we can do that.  (It would also be possible to
allow several of the above markup forms.)


[1]  http://www.pmichaud.com/pipermail/pmwiki-users/2007-February/039231.html
[2]  http://www.pmwiki.org/wiki/PITS/00887

More information about the pmwiki-users mailing list