OutlineLists

Summary: Deprecated, see WikiStylesPlus
Version:
Prerequisites: pmwiki-2.0.0
Status: Stable
Maintainer: Pm
Categories: Obsolete -- see WikiStylesPlus
Votes:

Questions answered by this recipe

Can I get PmWiki to generate numbered lists using standard outline numbering? (I.A.1.i.a)

Description

The following code enables an %outline% wikistyle to be applied to ordered lists:

    $HTMLStylesFmt[] = "
      ol.outline { list-style-type:upper-roman; }
      ol.outline ol { list-style-type:upper-alpha; }
      ol.outline ol ol { list-style-type:decimal; }
      ol.outline ol ol ol { list-style-type:lower-roman; }
      ol.outline ol ol ol ol { list-style-type:lower-alpha; }
    ";
    $WikiStyle['outline'] = array('class'=>'outline','apply'=>'list');

With this in place, one can create lists like:

Here's an outline list:

# %outline% top-level
# top-level
## second-level
### third-level
## second-level
## second-level
### third-level
#### fourth-level
##### fifth-level

While this list is just a normal PmWiki-ordered list:

# top-level
## second-level
### third-level

Here's an outline list:

  1. top-level
  2. top-level
    1. second-level
      1. third-level
    2. second-level
    3. second-level
      1. third-level
        1. fourth-level
          1. fifth-level

While this list is just a normal PmWiki-ordered list:

  1. top-level
    1. second-level
      1. third-level

Notes

Contributors

  • Pm, 2004-12-21

Sandbox

This page has the outline modification installed, so you can play with outline lists below.


  1. top-level
  2. top-level
    1. second-level
      1. third-levelkjhsfgdn dfsgh fg dsfgh dfgkhdgkdesrhgkerhgdk fgdf gdfg fd gdskfjhdf dsfl df df df dfkjhdfkhdrfg drfg df gfdghdfjkghfdkjghfgkedhgierhuirhdfiug fv fddhdk dfv ijkvfgdsfrg
    2. second-level
    3. second-level
      1. third-level
        1. fourth-level
          1. fifth-level

I just created a GuiEdit button function for this:

  $GUIButtons['outline'] = array(530, 
           '\\n# %outline% Top Level \\n## Second Level \\n### Third Level ',
           '\\n', '', '$GUIButtonDirUrlFmt/outline.gif"$[Outline list]"');

I also created a button image: Attach:outline.gifΔ - David A. Spitzley 4/1/05


Is it possible to modify this recipe to make numbered outlines like this?
1. top-level

1.1 second level
1.1.1 third level
1.1.2 third level
1.2 second level

2. top-level
etc.
shi September 05, 2005, at 05:45 PM

Unfortunately, AFAIK HTML doesn't directly support this style of numbering. --Pm

It's quite possible with CSS counters, but doesn't work in the majority of browsers. It goes something like this:

ol { counter-reset: item }
li { display: block }
li:before { content: counters(item, ".") " "; counter-increment: item }

Is it possible to modify this recipe to make numbered outlines like this?
1. top-level

a second level
i third level
ii third level
b second level

2. top-level
etc.
Melvyn 14th March 2006, at 10:41 AM

Hello Melvyn, This should acomplish what you are after.

 
$HTMLStylesFmt[] = "
  ol.outline2 { list-style-type:decimal; }
  ol.outline2 ol { list-style-type:lower-alpha; }
  ol.outline2 ol ol {  list-style-type:lower-roman; }
";
$WikiStyle['outline2'] = array('class'=>'outline2','apply'=>'list');

This has the same usage as above save use the %outline2% WikiStyle and lives along side the above or independent of the above without issue.

My best regards to you,

Feral March 14, 2007, at 05:18 PM