NRAO Home  >  Green Bank  |  Wiki Topic:    GB > TWiki > TocPluginHelp
   Welcome | Register | Changes | Topics | Index | Search | Go
If you see tags such as %SECTION0% on the next line, read TocPlugin

1. Table of Contents and Cross-Reference Plugin

This topic describes the facilities provided by the TOC TWiki Plugin for the support of documentation generation. The extensions support definition of an order among the topics in the web for the generation of tables of contents, together with cross-references that operate within, as well as between, topics.

1.1. Installation and Configuration

Installation of the Plugin is straightforward. Simply unpack the tar file at the top level of your TWiki installation.

1.1.1. The WebOrder special topic

The documentation extensions depend on the existance of a special topic called WebOrder, which is is analagous to a Framemaker "book". This topic should contain a list of the topics you want included. This list must be formatted as a TWiki-format bulleted list e.g.
   * PageOne
   * [[Page two]]
Both WikiWords and [[Odd Wiki Words]] may be used to refer to topics.

NOTES

1.2. Attributes on documentation tags

Following the TWiki standard, attributes are used to pass values to tags to control their behaviour. Attributes are given as a list of name = value pairs enclosed in curly braces {} after the tag name. For example:
%REF{type=Figure,topic="SpidersOfTheWorld",name="The Funnel Web"}%

NOTES

1.3. Sections and Tables of Contents

1.3.1. Creating sections using the SECTION tag

Supported attributes: name

Subsections may be inserted in any topic using the SECTIONn tag, where n is the required subsection level. The heading of the section is taken as all text after the tag up to the end of line. For example, the heading at the top of this section is marked with

%SECTION1{name=SECTION}% Creating sections using the =SECTION= tag

NOTES

1.3.1.1. The %SECTION0% tag

If a %SECTION0% tag occurs in a topic, the heading of that section will replace the topic name in the table of contents.

NOTES

1.3.2. Building the table of contents; the %TOC% tag

Supported attributes: depth topic

You can build a table of contents by inserting

%CONTENTS%
in a topic. The first level of the table of contents is normally the topics in the order of the list in WebOrder, though see 1.5. Getting clever for information about modifying section numbering from the WebOrder topic. Subsections listed in the table are automatically linked to the target SECTION.

1.3.2.1. Output from %CONTENTS{depth=2}% tag for this web

1.3.2.1.A Table of contents for this web

1.3.2.2. Output from %CONTENTS% tag for this topic

1.3.2.2.A Table of contents for this topic

1.3.3. The TOCCHECK tag

Supported attributes: none

Any topic (but most usually the WebOrder topic) may include the

%TOCCHECK%
tag. This causes the entries in the WebOrder topic to be cross-referenced against the files actually stored in the web (see WebIndex). Any topics which exist as files in the web but are missing from the WebOrder will be listed.

NOTES

1.3.3.1. Output from the %TOCCHECK% tag for this web

The following topics were not found in the WebOrder:
  1. AdminSkillsAssumptions
  2. AdrianLynch
  3. AlWilliams
  4. AndreaSterbini
  5. AppendixFileSystem
  6. BookView
  7. BumpyWord
  8. CalendarPlugin
  9. ChangePassword
  10. ChristopheVermeulen
  11. ColasNahaboo
  12. CrisBailiff
  13. DavidWarman
  14. DefaultPlugin
  15. DeleteOrRenameATopic
  16. DontNotify
  17. EditDoesNotIncreaseTheRevision
  18. EditTablePlugin
  19. EmptyPlugin
  20. ExampleTopicTemplate
  21. FileAttachment
  22. FileAttribute
  23. FormattedSearch
  24. GnuGeneralPublicLicense
  25. GoBox
  26. GoodStyle
  27. GrantBow
  28. HaroldGottschalk
  29. HiddenAttachment
  30. HowToResizeEditBox
  31. IncludeTopicsAndWebPages
  32. InstallPassword
  33. InstalledPlugins
  34. InstantEnhancements
  35. InterWikis
  36. InterwikiPlugin
  37. JohnAltstadt
  38. JohnTalintyre
  39. KevinKinnell
  40. KlausWriessnegger
  41. MainFeatures
  42. ManagingTopics
  43. ManagingWebs
  44. ManpreetSingh
  45. MartinCleaver
  46. MartinRaabe
  47. MathModePlugin
  48. MetaDataDefinition
  49. MetaDataRendering
  50. MikeMannix
  51. MoveTopic
  52. NewUserTemplate
  53. NicholasLee
  54. PeterFokkinga
  55. PeterThoeny
  56. PreviewBackground
  57. PrintUsingPDF
  58. RandyKramer
  59. RegularExpression
  60. ResetPassword
  61. RichardDonkin
  62. RyanFreebern
  63. SearchDoesNotWork
  64. SimultaneousEdits
  65. SiteMap
  66. SiteUsageStatistics
  67. SmiliesPlugin
  68. SpreadSheetPlugin
  69. StandardColors
  70. StanleyKnutson
  71. StartingPoints
  72. SvenDowideit
  73. TOCVariableIssue
  74. TOCVariableIssueExample
  75. TOCVariableIssueWorkaround
  76. TWikiAccessControl
  77. TWikiAdminCookBook
  78. TWikiCategoryTable
  79. TWikiContributor
  80. TWikiDocGraphics
  81. TWikiDocumentation
  82. TWikiDownload
  83. TWikiEnhancementRequests
  84. TWikiFAQ
  85. TWikiFaqTemplate
  86. TWikiForms
  87. TWikiFuncModule
  88. TWikiGlossary
  89. TWikiHistory
  90. TWikiInstallationGuide
  91. TWikiLogos
  92. TWikiMetaData
  93. TWikiPlannedFeatures
  94. TWikiPlugins
  95. TWikiPreferences
  96. TWikiRegistration
  97. TWikiRegistrationPub
  98. TWikiShorthand
  99. TWikiSite
  100. TWikiSiteTools
  101. TWikiSkins
  102. TWikiSystemRequirements
  103. TWikiTemplates
  104. TWikiTopics
  105. TWikiTutorial
  106. TWikiUpgradeGuide
  107. TWikiUpgradeTo01Dec2000
  108. TWikiUpgradeTo01Dec2001
  109. TWikiUpgradeTo01May2000
  110. TWikiUserAuthentication
  111. TWikiUsernameVsLoginUsername
  112. TWikiVariables
  113. TWikiWebsTable
  114. TablePlugin
  115. TemplateWeb
  116. TextEditor
  117. TextFormattingFAQ
  118. TextFormattingRules
  119. TimBernersLee
  120. UnlockTopic
  121. VitoMiliano
  122. WabiSabi
  123. WelcomeGuest
  124. WhatIsWikiWiki
  125. WikiCulture
  126. WikiName
  127. WikiNotation
  128. WikiReferences
  129. WikiSyntax
  130. WikiTopic
  131. WikiWikiClones
  132. WikiWord
  133. WindowsInstallCookbook
  134. XpTrackerPlugin
  135. YouAreHere
1.3.3.1.A Output of the %TOCCHECK% tag

1.4. Anchors and References - the ANCHOR, REF and REFTABLE tags

Bookmarks and references can be inserted into text using the ANCHOR and REF tags. These can be used for references, for example, to tables or figures.

NOTES

1.4.1. The ANCHOR tag

Supported attributes: type name display

The ANCHOR tag creates a jump target suitable for jumping to from somewhere else. The type adds the anchor to a "group"; this group is required when generating a reference to the anchor, and may be used to generate tables of same-type anchors (see 1.4.3. The REFTABLE tag below). The type can be any name, though convention suggests the use of types such as Figure and Table. The special group Section is used internally to refer to sections and subsections. Avoid using it for an ANCHOR or you may see strange results.

The ANCHOR tag is normally visible in the output, though it may be made invisible by setting the display attribute to no . For example:

%ANCHOR{type=Figure,name=A,display=no}% Here be sea
monsters
will generate an invisible anchor on the text (there's one one the line above, honest!) and
<A name="#Figure_A"> </A>
%ANCHOR{type=Table,name=A}% A wooden table
will generate: 1.4.1.A A wooden table

All the text between the anchor and the next end-of-line will be used to create the anchor. If the anchor is invisible, this text will be invisible too.

1.4.2. The REF tag

Supported attributes: type topic name

The REF tag may be used to refer to an anchor. Anchors are automatically inserted by SECTION tags or may be added using the ANCHOR tag. For a REF tag to work, the type of the target must be known. For example:

See %REF{type=Example,name=WebOrder}% for more information about WebOrder
will generate:

See 1.1.1.A The Weborder topic for more information about WebOrder

To refer to anchors in a different topic, use the topic attribute. You can refer to sections by name by using the special type Section e.g. %REF{type=Section,name=TOCCHECK}%.

If you refer to a non-existant anchor you are warned: for example,

%REF{type=Reference,name=NonExistantAnchor}%
generates

Reference TocPluginHelp:Reference:NonExistantAnchor not satisfied

1.4.3. The REFTABLE tag

Supported attributes: type

The REFTABLE tag can be used to build tables of references based on the type assigned to anchors. For example, if you have a lot of anchors of type Example you can build a table of all these anchors thus:

%REFTABLE{type=Example}%
This will insert a table like this:
Example
1.1.1.A The Weborder topic
1.3.2.1.A Table of contents for this web
1.3.2.2.A Table of contents for this topic
1.3.3.1.A Output of the %TOCCHECK% tag
1.4.3.A REFTABLE{type=Table} example
1.4.3.B REFTABLE{type=Figure} example
1.4.3.C REFTABLE{type=Section} example %REFTABLE{type=Section}%

and

%REFTABLE{type=Figure}%
will insert a table like this:
Figure
1.4.1.A Here be sea monsters

All topics listed in the WebOrder are scanned, but only anchors of the requested type will be listed.

NOTES

1.5. Getting clever

It is possible to change the way the table of contents for the web is ordered by using extra levels of indent in the WebOrder. If you indent a topic below another topic, then that topic will be treated as a section of the parent topic. Section numbers within the subtopic are adjusted accordingly. For example, say the WebOrder contains
   * [[Top level topic]]
   * AnotherTopLevelTopic
TopLevelTopic will be numbered 1., and the first SECTION1 within TopLevelTopic will be 1.1. AnotherTopLevelTopic will be numbered 2. If, instead, WebOrder contains
   * [[Top level topic]]
      * [[Second level topic]]
   * AnotherTopLevelTopic
TopLevelTopic will still be numbered 1., but now SecondLevelTopic will be numbered 1.1., and the first SECTION1 within SecondLevelTopic will be 1.1.1. The first SECTION1 within TopLevelTopic will now be numbered 1.2. AnotherTopLevelTopic will still be numbered 2.

1.6. Hints and Tips

1.7. Copyright

The TOC Plugin is a development of the Architectures and Systems Platforms group of Motorola Inc. and is protected by the following copyrights:

1.8. License

As required for the publication of all extensions to TWiki, the software is published under the terms of the GNU General Public License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details, published at http://www.gnu.org/copyleft/gpl.html

Topic TocPluginHelp . { Edit | Attach | Ref-By | Printable | Diffs | r1.1 | More }
Revision r1.1 - 14 Sep 2006 - 08:45 GMT - TWikiGuest Content copyright © 1999-2007 by the contributing authors.
All material on this collaboration platform is the property of the contributing authors.