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
| |
Simulated:
- This starts with 5
- This is six
- And seven
|
2. Define the type of the list
%LIST{ type="square" }%
* Item one
* Item two
* Item three
| |
Simulated:
- 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
| |
Simulated:
- Item one
- Item two
- Item three
|
The plugin could handle additional parameters in the future.
--
Contributors: PeterThoeny - 2011-01-06
Old Proposal
Test:
1 Item 1
2 Item 2 + 3
4 Item 4
results in:
- Item 1
- Item 2 + 3
- Item 4
I would expect auto-numbering only if all lines start with 1.
AC
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
KJL
--
Contributors: ArthurClemens
Discussion
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
- Second section
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:
- How to define list type for different indent levels?
- 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
- Some stuff
- More stuff
- 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