Feature Proposal: TOC variable to ignore null headers
Motivation
The current result of a
%TOC% is quite simply ugly if there are "jumps" in the header levels used in the topic.
Why would anyone ever want to have "jumps" in the header levels used in a topic? Because sometimes it simply looks better to skip to a lower header level than the immediate preceeding -1.
Try to do the same exercise in Word or
OpenOffice. Unlike TWiki they will not print a table of contents and put in "implicit" headers that do not exist in the document. It is not logical that TWiki adds something (even if empty) on its own to the TOC.
Description and Documentation
Suggest a new option on
%TOC% variable:
ignoreimplicitnullheaders
The result of this will be that TWiki will not include 'implicit' headers in the table of contents
Example: Topic use headers of level 1, 2 and 5.
- ignoreimplicitnullheaders is present in the TOC statement: The table of contents will not include empty lines for implicit level 3 and 4 headers.
- ignoreimplicitnullheaders is not present in the TOC statement: Default. The table of contents will look as today.
Examples
For the purpose of the example below is a header at level 5:
example header
This results in the following TOC for this topic page:
It is those lines with empty arrows we would like to get rid of. Indention is ok. Simply remove the lines with no text.
Impact
Implementation
Freetown already adds new functionality to
%TOC% rendering. Maybe not to late to add this.
See
AddControlOverTocRendering.
--
Contributors: LarsBruunxHansen - 24 Aug 2007
Discussion
I agree and would even suggest that the
ignoreimplicitnullheaders option be treated as the default behaviour.
--
KeithHelfrich - 24 Aug 2007
Note that in FF you see one line with 3 arrows. In IE you get the empty lines also.
I am against adding this
ignoreimplicitnullheaders feature.
We might as well call is
turnoffstupidbug
This is simply a bug that should be fixed and should be raised as a bug item with "normal" priority. I am sure noone finds the current behavior desired.
--
KennethLavrsen - 25 Aug 2007
I don't think this is really a bug with TOC, more of a rendering issue for list items that comes down to the chosen implementation in
HTML (
ul,
li).
The arrows is from the twikiToc
CSS class.
--
SteffenPoulsen - 25 Aug 2007