[pmwiki-users] How-To Change OL/UL List Designation . . .

Pico pmwiki at ben-amotz.com
Wed May 3 22:20:09 CDT 2006

Ben Wilson wrote:
> PmWiki uses white space at the beginning of a line to denote a
> pre-formatted text area. It also uses multiples of '*' to denote
> levels of unordered lists, and '#' to denote levels of ordered lists.
> What I would like to be able to do is use indentations of white space
> to denote these levels. For example:
>    * This is an unordered item
>       # This is an ordered sub-item of the unordered item.
>       # This is another sub-item
>    * This is the next item.
> There are two reasons for this. First, I take school notes in PmWiki
> (using pywe, my python substitute for pmwe) and it is easier to
> visualize the indentations this way. Second, I sometimes scrape
> material from other sites and when I paste into PmWiki I have to
> de-indent (I archive the material for personal use). In the latter
> case, I would like to just cut-n-paste rather than labor.
> I have tried to do this manually. First, to DisableMarkup("^ "), I had
> to rename markup "^ " because it would not disable otherwise. Second,
> when I got the indenting to work, rather than indent it would insert
> DLs to the appropriate level.
> Any suggestions would be appreciated.

Note that there is more going on with whitespace than just denoting 
pre-formatted text.

Pm introduced a whitespace indentation rule (2.0.11, 2.1.beta1, 2.1 beta 
21) that he described as follows in the release note for 2.1.0:

"Whitespace indentation rules now exist and are enabled by default. Any 
line that begins with whitespace and aligns with a previous list item is 
considered to be "within" that list item. Text folds and wraps as 
normal, and the (:linebreaks:) directive is honored. To turn off 
whitespace indentation, use DisableMarkup('^ws');."

Before you disable the whitespace rule, however, you might spend some 
time seeing how close it brings you to where you want to be (maybe you 
will want to modify the existing rule, rather than disable it and start 
from scratch).

For example, using whitepace indentation, the example you provided would 
  generate the items you described, as long as the whitespace caused an 
item to be lined up with the indent for the prior item, e.g.

* This is an unordered item
   # This is an ordered sub-item of the unordered item.
   # This is another sub-item
* This is the next item.

To see that example, visit Test/Whitespace.  To see other examples 
illustrating the behavior of the whitespace indentation rule, visit 
Test/BugOrFeature and PITS/00722


More information about the pmwiki-users mailing list