Tags:
create new tag
, view all tags
This patch abstracted from PatternSkinCodeChanges by CrawfordCurrie - 08 Jul 2004

Implemented: Formatted TOC

  • Status: Ready for inclusion (but needs checking of course)
  • License: GPL (just for clarity)
  • Summary: Adds enclosing TABLE around TOC, so it can be addressed by CSS. Adds alternative tag for TOCs called from outside topic.

Screenshot of Pattern TOC

I find a well-formatted TOC important. It should look different from body text - it is page navigation and should be easy to recognize from the content of the page.

I made a change in TWiki.pm to put TABLE tags around the TOC. See Patch file.

An alternative method (to not touch TWiki.pm) would be to create a variable in TWiki.TWikiPreferences, for instance FTOC (for Formatted TOC):

   * Set FTOC = <table class='toc'><tr><td><b>On this page:</b><br />%TOC%</td></tr></table>

... and then call

On this page:
, but this will break the use of parameters like %TOC{depth="2"} %.

This is the CSS I am using:

<style>
.toc { width: 100%; color: #333333; font-size: 11px; margin: 0.5em 0em 1em 0em; padding: 1em 0em 0em 0em; background-color: #F5F5F5; border-top: 1px solid #DDDDDD; border-bottom: 1px solid #DDDDDD; }
.toc b { margin-left: 0.5em; }
.toc td { font-size: 10px; line-height: 14px; border: none; }
.toc ul { list-style: outside; margin-left: 3em; padding: 1px; margin-top: 0px; list-style-image: url(/twiki/pub/TWiki/TWikiDocGraphics/arrow_down.gif); }
.toc A:link, .toc A:visited { text-decoration: none; }
.toc A:hover, .toc A:visited:hover { text-decoration: underline; }
</style>

Known problems

Possible solutions

-- ArthurClemens

Assigned to Peter because a decision is required on whether this goes in or not.

-- CC - 24 Jul 2004

This feature has been implemented in AddHeadingToToc. The outstanding bug has been solved in TocNotClosedProperly.

Should the CSS example get included in TWikiVariables? Or perhaps in a new CSS documention page?

-- ArthurClemens - 24 Jul 2004

I removed the Cairo link in the ScheduledFor form field since this feature is tracked in AddHeadingToToc.

TWiki's CSS classes should be documented in TWikiSkins, or at a CSS specific page linked from there. CSS documentation is mainly needed by Skin authors.

  • TWiki CSS Classes must be documented at CssClassNames - please add any that we are missing there.
    • I will as I am progressing with the skin. -- ArthurClemens - 25 Jul 2004

-- PeterThoeny - 25 Jul 2004

Topic attachments
I Attachment Action Size Date Who Comment
pngpng PatternsToc.png manage 40.2 K 28 Aug 2003 - 20:59 ArthurClemens Screenshot of TOC
elsediff TOC_surrounded_by_table.diff manage 1.8 K 28 Aug 2003 - 22:33 ArthurClemens Patch file to put formatting table around TOC
Topic revision: r7 - 25 Jul 2004 - 22:12:13 - ArthurClemens
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback