Multi-level, deep lists in dokuwiki

Dokuwiki is built in with only up to 3 levels of nested listing.  If you need to go deep in listing (such as 2.3.2.4.1) for sub-sections, follow these steps. 

Install the wrap plugin. 

Add the following code to the userstyle.css file (to be placed in <dokuwiki_root>/conf/

##userstyle.css##

div.dokuwiki div.wrap_list-deep ol {
  list-style-type: none;
}
 
div.dokuwiki div.wrap_list-deep > ol {
  counter-reset: leva 0; /* set to one lower than intended value of first list item */
}
 
div.dokuwiki div.wrap_list-deep ol li div.li::before {
  counter-increment: leva;
  content: counter(leva) ". ";
  color: inherit;
  font-weight: bold;
}
/* ~~~~~~ */
 
div.dokuwiki div.wrap_list-deep ol ol {
  list-style-type: none;
}
 
div.dokuwiki div.wrap_list-deep > ol ol {
  counter-reset: levb 0; /* set to one lower than intended value of first list item */
}
 
div.dokuwiki div.wrap_list-deep ol li li div.li::before {
  counter-increment: levb;
  content: counter(leva) "." counter(levb) ". ";
  color: inherit;
  font-weight: bold;
}
 
/* ~~~~~~ */
 
div.dokuwiki div.wrap_list-deep ol ol ol {
  list-style-type: none;
}
 
div.dokuwiki div.wrap_list-deep > ol ol ol {
  counter-reset: levc 0; /* set to one lower than intended value of first list item */
}
 
div.dokuwiki div.wrap_list-deep ol ol ol div.li::before {
  counter-increment: levc;
  content: counter(leva) "." counter(levb) "." counter(levc) ". ";
  color: inherit;
  font-weight: bold;
}

Within the dokuwiki you can then use simple wiki markdown to get deep-nested (ordered) lists, as follows:

<WRAP list-deep>
  - first level
    - second level
    - second level
  - first level
    - second level
  - first level
    - second level
      - third level
      - third level
   - second level
</WRAP>

Leave a Reply

Your email address will not be published. Required fields are marked *