Extension:ComplexList

What can this extension do?
This extension allows you to create complex lists more easily than does the existing MediaWiki syntax that I'm currently aware of from http://meta.wikimedia.org/wiki/Help:List

This copies the technique of other wikis, for example, MoinMoin http://moinmo.in/HelpOnMoinWikiSyntax#Lists

Disclaimer: this is my first extension, so probably fraught with error and weaknesses. Help welcome. Also, I have no idea how this would work in conjunction with the textarea toolbar - I never use it. (And this page alone&mdash;my effort to fill out the template&mdash;probably has a few issues. Sorry.)

Usage
Some examples.

NOTICE: after a * there must be a space.

Example A
Unordered lists

Using syntax described at http://meta.wikimedia.org/wiki/Help:List


 * Lists are easy to do:
 * start every line
 * with a star
 * more stars mean
 * deeper levels

results in


 * Lists are easy to do:
 * start every line
 * with a star
 * more stars mean
 * deeper levels

Using the cl tag

 * start every line * or an indented star * more indents mean deeper levels 
 * Lists are easy to do:
 * with a star

results (or should result) in

  Lists are easy to do:   start every line     with a star   or an indented star   more indents mean deeper levels   </li> </ul> </li> </ul>

Example B
Ordered lists of different list-style-type

Using syntax described at http://meta.wikimedia.org/wiki/Help:List

We must resort to HTML

<ol style="list-style-type:lower-latin"> About the author</li> Foreword to the first edition</li> <ol style="list-style-type:lower-roman"> About the author</li> Foreword to the first edition</li> Foreword to the second edition</li> </ol> Foreword to the second edition</li> </ol>

results in

<ol style="list-style-type:lower-latin"> About the author</li> Foreword to the first edition</li> <ol style="list-style-type:lower-roman"> About the co-author</li> Foreword to the first sub-edition</li> Foreword to the second sub-edition</li> </ol> Foreword to the second edition</li> </ol>

Using the cl tag

 a. About the author i. About the co-author * Foreword to the first sub-edition * Foreword to the second sub-edition </cl>
 * Foreword to the first edition
 * Foreword to the second edition

results (or should result) in

<ol style="list-style-type: lower-latin;">  About the author </li>  Foreword to the first edition <ol style="list-style-type: lower-roman;">  About the co-author </li> <li> Foreword to the first sub-edition </li> <li> Foreword to the second sub-edition </li> </ol> </li> <li> Foreword to the second edition </li> </ol>

Example C
Much-text list-items separated by blank lines to make them easy to read (and edit) in the editing view

Using syntax described at http://meta.wikimedia.org/wiki/Help:List

do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laboru
 * 1) Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed

accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.
 * 1) Sed ut perspiciatis unde omnis iste natus error sit voluptatem

consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur?
 * 1) Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet,

results in


 * 1) Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laboru


 * 1) Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.


 * 1) Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur?

Using the cl tag

<cl> 1. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laboru

accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.
 * Sed ut perspiciatis unde omnis iste natus error sit voluptatem

consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? </cl>
 * Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet,

results (or should result) in

<ol style="list-style-type: decimal;"> <li> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laboru </li> <li> Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. </li> <li> Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? </li> </ol>

Example D
To put multiple paragraphs into a single list item:

Using syntax described at http://meta.wikimedia.org/wiki/Help:List


 * 1) list item A1
 * 2) list item A2
 * continuing list item A2
 * further continuing list item A2
 * 1) list item A3

results in


 * 1) list item A1
 * 2) list item A2
 * continuing list item A2
 * further continuing list item A2
 * 1) list item A3

Using the cl tag

<cl> 1. list item A1


 * list item A2

continuing list item A2

further continuing list item A2

</cl>
 * list item A3

results (or should result) in

<ol> <li> list item A1   </li> <li> list item A2           continuing list item A2            further continuing list item A2    </li> <li> list item A3   </li> </ol>

Example E
To include a single-line pre block in a list item

Using syntax described at http://meta.wikimedia.org/wiki/Help:List


 * 1) list item A1
 * 2) list item A2&lt;/pre>
 * 3) list item A3

results in


 * 1) list item A1
 * 2) list item A2
 * 3) list item A3

Using the cl tag

<cl> 1. list item A1 </cl>
 * list item A2&lt;/pre>
 * list item A3

results (or should result) in

<ol style="list-style-type: decimal;"> <li> list item A1    </li> <li> list item A2    </li> <li> list item A3    </li> </ol>

Example F
To include a multi-line pre block in a list item

Using syntax described at http://meta.wikimedia.org/wiki/Help:List

is
 * 1) list item A1
 * 2) list item A2

some

pre text&lt;/pre>
 * 1) list item A3

results in

is
 * 1) list item A1
 * 2) list item A2

some

pre text
 * 1) list item A3

So we have to resort to HTML

<ol> <li>list item A1</li> <li> list item A2 is

some

pre text&lt;/pre></li> <li>list item A3</li> </ol>

to get

<ol> <li>list item A1</li> <li> list item A2 is

some

pre text </li> <li>list item A3</li> </ol>

Using the cl tag

<cl> 1. list item A1 is
 * list item A2

some

pre text&lt;/pre> </cl>
 * list item A3

results (or should result) in

<ol style="list-style-type: decimal;"> <li> list item A1    </li> <li> list item A2 is

some

pre text </li> <li> list item A3    </li> </ol>

Example G
To include a WikiText table in a list

Using syntax described at http://meta.wikimedia.org/wiki/Help:List, I don't think we can do this


 * 1) list item A1
 * Orange
 * Apple
 * Bread
 * Pie
 * Butter
 * Ice cream
 * }
 * 1) list item A3
 * Ice cream
 * }
 * 1) list item A3

results in


 * 1) list item A1
 * Orange
 * Apple
 * Bread
 * Pie
 * Butter
 * Ice cream
 * }
 * 1) list item A3
 * Ice cream
 * }
 * 1) list item A3

Use the cl tag

<cl> 1. list item A1 </cl>
 * Orange
 * Apple
 * Bread
 * Pie
 * Butter
 * Ice cream
 * }
 * list item A3
 * Ice cream
 * }
 * list item A3

results in

<ol style="list-style-type: decimal;"> <li> list item A1    </li> <li> </li> <li> list item A3    </li> </ol>

Download instructions
Please cut and paste the code found below and place it in. Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.

Installation
To install this extension, add the following to LocalSettings.php:

Configuration parameters
None.

User rights
Not applicable

Code
of the  file: