create new tag
, view all tags

Feature Proposal: Overriding numeric lists

Implement a ListPlugin to manage ordered and unordered lists in TWiki topics, analogous to the TablePlugin that manages TWiki tables. The ListPlugin handles a new %LIST{}% variable that is added before the list (as %TABLE{}% does for tables).

Supported Parameters

Initially, three parameters are supported:

1. Define the start number of a numbered list

%LIST{ start="5" }%
   1. This starts with 5
   1. This is six
   1. And seven


  1. This starts with 5
  2. This is six
  3. And seven

2. Define the type of the list

%LIST{ type="square" }%
   * Item one
   * Item two
   * Item three


  • Item one
  • Item two
  • Item three

CSS1 defines a list-style-type with possible values: disc, circle, square, decimal, decimal-leading-zero, lower-roman, upper-roman, lower-greek, lower-latin, upper-latin, armenian, georgian, lower-alpha, upper-alpha, none. See http://www.w3.org/TR/REC-CSS1/#list-style-type (CSS1) and http://www.w3.org/TR/CSS2/generate.html#lists (CSS2)

3. Define an image for the bullet

%LIST{ image="%ICONURL{led-green}%" }%
   * Item one
   * Item two
   * Item three


  • Item one
  • Item two
  • Item three

The plugin could handle additional parameters in the future.

-- Contributors: PeterThoeny - 2011-01-06

Old Proposal


   1 Item 1
   2 Item 2 + 3
   4 Item 4
results in:
  1. Item 1
  2. Item 2 + 3
  3. Item 4

I would expect auto-numbering only if all lines start with 1.


That is actually also like it worked in Cairo.

We have to be careful. When users write 1, 2, 3, 4.. TWiki neatly renders the list as a correct HTML numbered list. Even I do like that often because it makes it possible to see the actual number in edit mode and that helps editing long lists.

If we suddenly only render the numbers as a HTML list if all numbers are 1 most old topics with numbered lists will look like crap and users can no longer choose to write the real numbers and get a nice looking list.

I can show an example of the result by putting 4 spaces instead of 3.

1 Some first text 2 Some second text 3 Some third text 4 Some forth text

Well. Not exactly the result the user will want or expects.

The best would be if TWiki auto-numbered when all numbers are 1 and made neat rendering that looks like the HTML list when numbers are not all 1's and allowed you to jump in the numbering or start from another number than 1.

But this makes the whole thing more complex I guess because the current implementation makes the brower do the counting based on very simple HTML tags.

So I am not sure how to tackle this one. But you have hit a nail that confuses users for sure. But we have to think about how to fix it so we do not break the nice indented rendering for those that did/do not write only 1's


-- Contributors: ArthurClemens


Lets look at the use cases. How often would you need a numbered list with gaps, such as 1, 2, 4, 5, 7? I have never seen a case like this. However, is there a case where you'd want to control the initial number, say, starting from 7? I wished I had this in the past. Example:

  • First section
    • 1. foo
    • 2. bar
  • Second section
    • 3. continue
    • 4. etc.

So, I'd rather stay compatible by keeping the current spec, and introduce a new syntax to start with a specific number.

-- PeterThoeny - 15 Apr 2007

A numbered list with gaps occurs when you create a TODO list. And you assign todo items to people. Now after 2 days you decide to merge item 3 with item 2. For the list to work correctly you have to know how TWiki handles numbered lists (any numeric is converted to a numbered list item and then renumbered sequentially). That is not something end users would have to know.

-- ArthurClemens - 15 Apr 2007

which is somewhat different from the most common use case :/ Arthur, what you are talking about is a UID (Unique Identifier), and the html list numbering isn't really a safe way to acheive that - its one of the many reasons why I designed the BugsContrib the way I did.

-- SvenDowideit - 15 Apr 2007

Technically it is possible to start with a specific number. See http://www.w3.org/TR/CSS2/generate.html#counters and http://www.arraystudio.com/as-workshop/make-ol-list-start-from-number-different-than-1-using-css.html

-- PeterThoeny - 2010-07-07

What is a good syntax to define the start value of a numbered list? Some ideas:

Option 1:

   5. Five -- value of first numbered bullet determines the start value
   1. Six
   1. Seven

Option 2:

%LISTSTART{5}% -- new LISTSTART variable, added before the list
   1. Five
   1. Six
   1. Seven

Option 3:

   1. %LISTSTART{5}% Five -- new LISTSTART variable, added to the first list item
   1. Six
   1. Seven

Option 4:

%LIST{start="5"}% -- new LIST variable, added before the list (like TABLE for table)
   1. Five
   1. Six
   1. Seven

The LIST variable could also handle parameter bullet="%ICON{led-gray}%"

Opinions? Which syntax is the most intuitive?

-- PeterThoeny - 2010-10-23

This is now an accepted proposal based on the 7 days feedback period.

I am going for option 4, to be implemented as a new ListPlugin.

-- PeterThoeny - 2010-11-08

See related ContinueListNumbering.

-- PeterThoeny - 2011-01-04

See related TildeForULwithoutBullets.

We could add a type="none" parameter to support lists without bullets. Valid types: disc, circle, square, decimal, lower-roman, upper-roman, lower-alpha, upper-alpha, none. See http://www.w3.org/TR/REC-CSS1/#list-style-type

I updated the proposal on top accordingly.

-- PeterThoeny - 2011-01-06

Questions comes to mind:

  1. How to define list type for different indent levels?
  2. WIBNIF it is possible to define a image bullet per bullet?

As for different levels, one possible solution is to define parameters with numbers, such as %LIST{ type="square" type2="decimal" type3="upper-roman" }% for level 1, 2 and 3. Alternatively we could define %LIST{ type="square, decimal, upper-roman" }%. Yet another option is to allow LIST in bullets for lower levels:

%LIST{ type="square" }%
   * one
      * %LIST{ type="decimal" }% level 2
      * next of level 2
         * %LIST{ type="upper-roman" }% level 3
         * next of level 3
   * two

Which option is more intuitive?

As for image per bullet, possibly this spec:

%LIST{ image="%ICONURL{led-green}%" }% <!-- default is led-green -->
   * one <!-- this one is led-green -->
   * %LIST{ image="%ICONURL{led-red}%" }% two <!-- this one is led-red -->
   * %LIST{ image="%ICONURL{led-blue}%" }% three <!-- this one is led-blue -->
   * four <!-- this one is led-green again -->

-- PeterThoeny - 2011-01-07

Ah, need to think about this a little. Backtracking a little - this could get so messy.

Here is my justification for having an "ordered" list with gaps. We have a book of rules for railroads, which can have many sub-paragraphs, like so:

Rule 109 - Blah blah blah

  1. Some stuff
  2. More stuff
  3. Still more stuff

Which is set in stone, but they issue bulletin updates of these rules, and they may only change sub-paragraphs (b) and (d), so, we would have a topic with:

Rule 109 - Blah blah blah

  • (b) More stuff revised
  • (d) New stuff

-- AaronLWalker - 2011-01-07

Edit | Attach | Watch | Print version | History: r14 < r13 < r12 < r11 < r10 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r14 - 2011-01-07 - AaronLWalker
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.