We relaunched the TWiki.org project with an expanded TWiki charter, and we invite you to participate! The TWiki.org Code of Conduct agreement took effect on 27 Oct 2008. We ask existing twiki.org users to opt-in. -- PeterThoeny - 27 Oct 2008
You are here: TWiki> Codev Web>AddHeadingToToc (28 Jun 2005, JosieMcGeever)
Tags:
archive_me1Add my vote for this tag stale_content2Add my vote for this tag create new tag
, view all tags

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="TWiki04x02" 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
Topic revision: r14 - 28 Jun 2005 - 13:10:14 - JosieMcGeever
 
TWIKI.NET
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