r14 - 28 Jun 2005 - 13:10:14 - JosieMcGeeverYou are here: TWiki >  Codev Web > AddHeadingToToc
Tags:
stale_content 2 Add my vote for this tag, , create new tag

Implemented: New title parameter for TOC variable

Documentation in TWikiVariables, changed content indicated in red:

%TOC{"SomeTopic" ...}% Table of Contents. Shows a TOC that is generated automatically based on headings of a topic. Headings in WikiSyntax ("---++ text") and HTML ("<h2>text</h2>") are taken into account. Any heading text after "!!" is excluded from the TOC; for example, write "---+!! text" if you do not want to list a header in the TOC. Supported parameters:
Parameter: Description: Default:
"TopicName" topic name Current topic
web="Name" Name of web Current web
depth="2" Limit depth of headings shown in TOC 6
title="Some title" Title to appear at top of TOC none
Examples: %TOC{depth="2"}%, %TOC{"TWikiDocumentation" web="TWiki04x01" title="Contents:" }%

Test style if you want to test the TOC:

<style>
.TWikiToc { font-size: 95%; line-height: 1.3em; margin: 2em 0 2.5em 0; padding: 0; }
.TWikiToc li { margin-left: 1em; }
.TWikiToc a:link, #twikitoc a:visited { text-decoration: none; }
.TWikiToc a:hover { text-decoration: underline; }
.TWikiToc ul { list-style: outside; margin: 0; padding: 0 0 0 0.5em; }
.TWikiToc .title { margin: 0; padding: 0; font-weight: bold; color:orange; }
</style>

Patch: patch_TOC_heading4.diff (revised, in CVS)

Contributors:
-- ArthurClemens - 05 Jan 2004
-- PeterThoeny - 08 Jan 2004

test headers:

Test heading h1

Test heading h2 This text is ignored for the TOC.

Test heading h3

Test heading h2


Removed brainstorming and comments; see topic history.
Changed id=twikitoc to class=TWikiToc to maintain uniform CSS tagging.

-- ArthurClemens - 10 Apr 2004


Topic attachments
I Attachment Action Size Date Who Comment
elsediff patch_TOC_heading.diff manage 0.7 K 05 Jan 2004 - 17:59 ArthurClemens Patch to add a heading parameter to TOC
elsediff patch_TOC_heading2.diff manage 1.1 K 08 Jan 2004 - 08:47 PeterThoeny Revised patch, in CVS
elsediff patch_TOC_heading3.diff manage 1.1 K 06 Jan 2004 - 15:20 ArthurClemens Revision of patch 2
elsediff patch_TOC_heading4.diff manage 1.1 K 08 Jan 2004 - 08:47 PeterThoeny Revised patch, in CVS
Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r14 < r13 < r12 < r11 < r10 | More topic actions
 
Powered by TWiki
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 SourceForge.net Logo