NestedMarkups

Summary: Allows nested (:markup ...:) ... (:markupend:)
Version: 2017-10-25
Prerequisites: PmWiki 2.2.0
Status: Beta
Maintainer: Chuck G
License: GPL2+
Categories: Markup PHP72
Users: (view? / edit)

Questions answered by this recipe

How can I nest (:markup ...:) ... (:markupend:)?

Description

This script overrides the markup for ( :markup ...: ) ... ( :markupend: ) to allow embedded digits so that they can be nested.

Installation

Download nestedmarkups.phpΔ and copy to the cookbook folder. Install by adding to config.php:

include_once("$FarmD/cookbook/nestedmarkups.php");

Usage

With this recipe, the (:markup:) and (:markupend:) markups can contain a number, similar to what can be done with (:div:) and (:if:), to allow them to be nested. Any numbers can be used as long as they match in the (:markup:) and (:markupend:).

This example is enclosed in (:markup3:)...(:markup3end:) so you can see the markup used to nest a markup.

!!! Demo of Nested Markups
This could be useful if you want to demonstrate [@(:@][@markup:)@]'s features.

(:markup2:)
!!! Vertical vs. Horizontal [@(:@][@markup:)@]s
This is a "vertical" [@(:@][@markup:)@]:

(:markup:)
* This is line 1.
* This is line 2.
(:markupend:)

This is a "horizontal" [@(:@][@markup:)@]:

(:markup class=horiz:)
* This is line 1.
* This is line 2.
(:markupend:)
(:markup2end:)

Demo of Nested Markups

This could be useful if you want to demonstrate (:markup:)'s features.

!!! Vertical vs. Horizontal [@(:@][@markup:)@]s
This is a "vertical" [@(:@][@markup:)@]:

(:markup:)
* This is line 1.
* This is line 2.
(:markupend:)

This is a "horizontal" [@(:@][@markup:)@]:

(:markup class=horiz:)
* This is line 1.
* This is line 2.
(:markupend:)

Vertical vs. Horizontal (:markup:)s

This is a "vertical" (:markup:):

* This is line 1.
* This is line 2.
  • This is line 1.
  • This is line 2.

This is a "horizontal" (:markup:):

* This is line 1.
* This is line 2.
  • This is line 1.
  • This is line 2.

Notes

Change log / Release notes

2017-10-25 Initial release.

If the recipe has multiple releases, then release notes can be placed here. Note that it's often easier for people to work with "release dates" instead of "version numbers".

Contributors

Comments

See discussion at NestedMarkups-Talk?

User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.