If you see tags such as %SECTION0% on the next line, read TocPlugin

This topic describes the facilities provided by the TOC 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.

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

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 wiki-format bulleted list e.g.
   * PageOne
   * [[Page two]]
Both WikiWords and [[Odd Wiki Words]] may be used to refer to topics.

NOTES
  • The WebOrder can contain any other TML or HTML formatting but it should be noted that all TML-format list bullets in the topic are taken as part of the ordering list.

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
  • Attribute values that contain only no spaces or punctuation need not be quoted, but values containing punctuation or white space must be protected by double quotes. You are highly recommended to stick to values that don't require quoting! All attribute names and values are case sensitive.

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
  • See also Bad REF: Current topic not in WebOrder for information about modifying section numbering from the WebOrder topic.
  • Sections do not have to be named, but if they are not then they can only be referred to by knowing the exact section number. Section names must be unique within the topic.
  • The only way to close a section is to start a new section with a different level, or to end the topic.
  • You can still use standard HTML heading tags such as <H1>, but sections marked this way will not be included in the table of contents.

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

NOTES
  • The name attribute cannot be used to refer to a %SECTION0% 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 Bad REF: Current topic not in WebOrder for information about modifying section numbering from the WebOrder topic. Subsections listed in the table are automatically linked to the target SECTION.

  • The topic attribute may be used to generate a table of contents for just one topic.
  • The depth attribute may be used to set the maximum number of levels to generate.

Bad topic TocPluginHelp

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
  • Any topics that begin with the characters "Web" are special topics and are excluded from the list, though they can still be listed in the WebOrder and will appear in the table of contents.

The following topics were not found in the WebOrder:
  1. ACRONYM
  2. AccessControl
  3. AdminDocumentationCategory
  4. AdminSkillsAssumptions
  5. AdminToggle
  6. AdminToolsCategory
  7. AppendixCascadingStyleSheets
  8. AutoViewTemplatePlugin
  9. BeginnersStartHere
  10. BookView
  11. BookmakerPlugin
  12. BulkRegistration
  13. BulkResetPassword
  14. Category
  15. ChangeEmailAddress
  16. ChangePassword
  17. ClassMethod
  18. CommandAndCGIScripts
  19. CommentPlugin
  20. CommentPluginTemplate
  21. CompareRevisionsAddOn
  22. CompareRevisionsAddonPlugin
  23. CompleteDocumentation
  24. ConfigurePlugin
  25. Contribs
  26. ContributedAddOns
  27. CountryList
  28. DataForms
  29. DefaultPreferences
  30. DefaultPreferencesForm
  31. DefaultUserRegistration
  32. DefaultWebStatistics
  33. DeveloperDocumentationCategory
  34. DevelopingPlugins
  35. DocumentGraphics
  36. EditRowPlugin
  37. EditRowPluginExamples
  38. EditTablePlugin
  39. EditingShorthand
  40. EmptyPlugin
  41. EnhancementRequests
  42. ExampleTopicTemplate
  43. FAQAnApplicationWithWikiForm
  44. FAQDeleteOrRenameATopic
  45. FAQDeleteOrRenameAnAttachment
  46. FAQDownloadSources
  47. FAQEditDoesNotIncreaseTheRevision
  48. FAQEditTemplate
  49. FAQForm
  50. FAQGnuGeneralPublicLicense
  51. FAQHiddenUsersAndGroups
  52. FAQRebuildingWikiUsersTopic
  53. FAQSearchDoesNotWork
  54. FAQSimultaneousEdits
  55. FAQTemplate
  56. FAQTroubleshootingExtensions
  57. FAQViewTemplate
  58. FAQWhatIsWikiWiki
  59. FAQWhyYouAreAskedToConfirm
  60. FamFamFamContrib
  61. FamFamFamFlagIcons
  62. FamFamFamFoswikiExtras
  63. FamFamFamMiniIcons
  64. FamFamFamMintIcons
  65. FamFamFamSilkCompanion1Icons
  66. FamFamFamSilkCompanion2Icons
  67. FamFamFamSilkGeoSilkIcons
  68. FamFamFamSilkIcons
  69. FastCGIEngineContrib
  70. FileAttachment
  71. FileAttribute
  72. FormatTokens
  73. FormattedSearch
  74. FoswikiServerInformation
  75. FrequentlyAskedQuestion
  76. FrequentlyAskedQuestions
  77. GlossaryOfTerms
  78. GoBox
  79. GoodStyle
  80. HierarchicalNavigation
  81. HierarchicalNavigationChildExample
  82. HistoryPlugin
  83. HomePagePlugin
  84. IconService
  85. IfStatements
  86. IncludeTopicsAndWebPages
  87. InstallationGuide
  88. InstallationGuidePart2
  89. InstalledPlugins
  90. InstantEnhancements
  91. InterWikis
  92. InterwikiPlugin
  93. JEditableContrib
  94. JQueryAjaxHelper
  95. JQueryAnimate
  96. JQueryAutocomplete
  97. JQueryBgiframe
  98. JQueryBlockUI
  99. JQueryButton
  100. JQueryChili
  101. JQueryCodingStandards
  102. JQueryCookie
  103. JQueryCorner
  104. JQueryCycle
  105. JQueryDebug
  106. JQueryEasing
  107. JQueryEmpty
  108. JQueryFarbtastic
  109. JQueryFluidFont
  110. JQueryFocus
  111. JQueryFontAwesome
  112. JQueryForm
  113. JQueryFoswiki
  114. JQueryGradient
  115. JQueryHoverIntent
  116. JQueryI18N
  117. JQueryInnerFade
  118. JQueryLiveQuery
  119. JQueryLoader
  120. JQueryLocalScroll
  121. JQueryMaskedInput
  122. JQueryMasonry
  123. JQueryMedia
  124. JQueryMetadata
  125. JQueryMigrate
  126. JQueryPNotify
  127. JQueryPlaceholder
  128. JQueryPlugin
  129. JQueryPopUpWindow
  130. JQueryQueryObject
  131. JQueryRating
  132. JQueryRender
  133. JQueryScrollTo
  134. JQuerySerialScroll
  135. JQueryShake
  136. JQueryShrinkUrls
  137. JQuerySimpleModal
  138. JQuerySlimbox
  139. JQueryStars
  140. JQuerySuperfish
  141. JQuerySupersubs
  142. JQueryTabpane
  143. JQueryTextboxList
  144. JQueryTmpl
  145. JQueryTooltip
  146. JQueryTreeview
  147. JQueryUI
  148. JQueryUIAutocomplete
  149. JQueryUIDialog
  150. JQueryUITooltip
  151. JQueryValidate
  152. JQueryView
  153. JQueryWikiWord
  154. JSCalendarContrib
  155. JSCalendarContribInline
  156. JSTreeContrib
  157. JavascriptFiles
  158. JsonRpcContrib
  159. LanguageSelector
  160. Macros
  161. MacrosQuickReference
  162. MailerContrib
  163. MailerContribPlugin
  164. MainFeatures
  165. ManagingTopics
  166. ManagingUsers
  167. ManagingWebs
  168. MetaData
  169. ModPerlEngineContrib
  170. NatEditHelpText
  171. NatEditPlugin
  172. NatEditWordHelpText
  173. NewUserTemplate
  174. ObjectMethod
  175. OriginalDocumentGraphics
  176. PackageForm
  177. PageCaching
  178. ParentList
  179. PatternSkin
  180. PatternSkinCss
  181. PatternSkinCssCookbook
  182. PatternSkinCssCookbookCenterPage
  183. PatternSkinCssCookbookCenterPageBorder
  184. PatternSkinCssCookbookEditTableStyle
  185. PatternSkinCssCookbookFonts
  186. PatternSkinCssCookbookHideActions
  187. PatternSkinCssCookbookNoLeftBar
  188. PatternSkinCssCookbookNoTopBar
  189. PatternSkinCssCookbookSidebarBackground
  190. PatternSkinCssCookbookSidebarToggle
  191. PatternSkinCustomization
  192. PatternSkinElements
  193. PatternSkinGraphics
  194. PatternSkinHorizontalNavigationExample
  195. PatternSkinNavigation
  196. PatternSkinTheme
  197. PatternSkinTheme115
  198. PatternSkinTheme2009
  199. PatternSkinThemeFatWilly
  200. PatternSkinThemeFatWillyNavigation
  201. PendingRegistrations
  202. PendingRegistrationsTemplate
  203. PerlDependencyReport
  204. PerlDoc
  205. PlainFileStoreContrib
  206. PlainSkin
  207. Plugins
  208. PreferenceSettings
  209. PreferencesPlugin
  210. PreviewBackground
  211. PrintSkin
  212. ProjectContributor
  213. ProjectLogos
  214. PubLinkFixupPlugin
  215. PublishedAPI
  216. QuerySearch
  217. QuerySearchPatternCookbook
  218. RCSStoreContrib
  219. ReferenceManual
  220. RegularExpression
  221. ReleaseHistory
  222. ReleaseNotes01x00
  223. ReleaseNotes01x01
  224. ReleaseNotes02x00
  225. ReleaseNotes02x01
  226. RemoveUser
  227. RenameWeb
  228. RenderListPlugin
  229. ResetPassword
  230. SearchHelp
  231. SearchPatternCookbook
  232. SiteChanges
  233. SiteMap
  234. SitePermissions
  235. SiteToolStatistics
  236. SiteTools
  237. SkinBrowser
  238. SkinTemplateTokens
  239. SkinTemplateViewTemplate
  240. SkinTemplates
  241. Skins
  242. SlideShowPlugin
  243. SmiliesPlugin
  244. SpreadSheetPlugin
  245. StandardColors
  246. StaticMethod
  247. SubscribePlugin
  248. SystemRequirements
  249. TWikiCompatibilityPlugin
  250. TablePlugin
  251. TemplateTopics
  252. TemplateWeb
  253. TextEditor
  254. TimBernersLee
  255. TimeSpecifications
  256. TinyMCEFrequentlyAskedQuestions
  257. TinyMCEPlugin
  258. TinyMCEQuickHelp
  259. TipTopic001
  260. TipTopic002
  261. TipTopic003
  262. TipTopic004
  263. TipTopic005
  264. TipTopic006
  265. TipTopic007
  266. TipTopic008
  267. TipTopic009
  268. TipTopic010
  269. TipTopic011
  270. TipTopic012
  271. TipTopic013
  272. TipTopic014
  273. TipTopic015
  274. TipTopic016
  275. TipTopic017
  276. TipTopic018
  277. TipTopic019
  278. TipTopic020
  279. TipTopic021
  280. TipTopic022
  281. TipTopic023
  282. TipTopic024
  283. TipTopic025
  284. TipTopic026
  285. TipTopic027
  286. TipTopic028
  287. TipTopic029
  288. TipsContrib
  289. TipsOfTheDay
  290. TipsOfTheDayAddNew
  291. TipsOfTheDayAdmin
  292. TipsOfTheDayInclude
  293. TipsOfTheDayTemplate
  294. TipsTopics
  295. TocPluginHelp
  296. TopicClassification
  297. TopicDoesNotExistViewTemplate
  298. TopicMarkupLanguage
  299. TopicUserMappingContrib
  300. TopicsAndWebs
  301. TwentyMinuteTutorial
  302. TwistyPlugin
  303. UpdatesPlugin
  304. UpgradeGuide
  305. UserAuthentication
  306. UserDocumentationCategory
  307. UserForm
  308. UserFormHelp
  309. UserName
  310. UserRegistration
  311. UserRegistrationParts
  312. UserSetting
  313. UserToolsCategory
  314. UsersGuide
  315. UsersTemplate
  316. UsingHTML
  317. VarACTIVATEDPLUGINS
  318. VarADDTOHEAD
  319. VarADDTOZONE
  320. VarALLVARIABLES
  321. VarATTACHURL
  322. VarATTACHURLPATH
  323. VarAUTHREALM
  324. VarBASETOPIC
  325. VarBASEWEB
  326. VarBUTTON
  327. VarCALC
  328. VarCALCULATE
  329. VarCOMMENT
  330. VarCOVER
  331. VarDATE
  332. VarDISPLAYTIME
  333. VarEDITTABLE
  334. VarENCODE
  335. VarENDCOLOR
  336. VarENDINCLUDE
  337. VarENDSECTION
  338. VarENDTAB
  339. VarENDTABPANE
  340. VarENDTWISTY
  341. VarENDTWISTYTOGGLE
  342. VarENV
  343. VarEXAMPLETAG
  344. VarEXPAND
  345. VarFAILEDPLUGINS
  346. VarFORMAT
  347. VarFORMFIELD
  348. VarGMTIME
  349. VarGROUPINFO
  350. VarGROUPS
  351. VarHISTORY
  352. VarHOMETOPIC
  353. VarHTTP
  354. VarHTTPHOST
  355. VarHTTPS
  356. VarICON
  357. VarICONURL
  358. VarICONURLPATH
  359. VarIF
  360. VarINCLUDE
  361. VarINCLUDINGTOPIC
  362. VarINCLUDINGWEB
  363. VarJQICON
  364. VarJQICONPATH
  365. VarJQPLUGINS
  366. VarJQREQUIRE
  367. VarJQTHEME
  368. VarLANG
  369. VarLANGUAGE
  370. VarLANGUAGES
  371. VarLOCALSITEPREFS
  372. VarLOGIN
  373. VarLOGOUT
  374. VarMAINWEB
  375. VarMAKETEXT
  376. VarMETA
  377. VarMETASEARCH
  378. VarNONCE
  379. VarNOP
  380. VarNOTIFYTOPIC
  381. VarPERLDEPENDENCYREPORT
  382. VarPLUGINDESCRIPTIONS
  383. VarPLUGINVERSION
  384. VarPOPUPWINDOW
  385. VarPUBURL
  386. VarPUBURLPATH
  387. VarQUERY
  388. VarQUERYPARAMS
  389. VarQUERYSTRING
  390. VarREMOTEADDR
  391. VarREMOTEPORT
  392. VarREMOTEUSER
  393. VarRENDERLIST
  394. VarRENDERZONE
  395. VarREVARG
  396. VarREVINFO
  397. VarREVTITLE
  398. VarSCRIPTNAME
  399. VarSCRIPTSUFFIX
  400. VarSCRIPTURL
  401. VarSCRIPTURLPATH
  402. VarSEARCH
  403. VarSERVERINFORMATION
  404. VarSERVERTIME
  405. VarSESSIONID
  406. VarSESSIONVAR
  407. VarSESSIONVARIABLE
  408. VarSET
  409. VarSHOWPREFERENCE
  410. VarSKIN
  411. VarSLIDESHOWEND
  412. VarSLIDESHOWSTART
  413. VarSPACEDTOPIC
  414. VarSPACEOUT
  415. VarSTARTINCLUDE
  416. VarSTARTSECTION
  417. VarSTATISTICSTOPIC
  418. VarSTOPINCLUDE
  419. VarSTOPSECTION
  420. VarSUBSCRIBE
  421. VarSYSTEMWEB
  422. VarTAB
  423. VarTABLE
  424. VarTABPANE
  425. VarTOC
  426. VarTOPIC
  427. VarTOPICLIST
  428. VarTWIKIWEB
  429. VarTWISTY
  430. VarTWISTYBUTTON
  431. VarTWISTYHIDE
  432. VarTWISTYSHOW
  433. VarTWISTYTOGGLE
  434. VarURLPARAM
  435. VarUSERINFO
  436. VarUSERNAME
  437. VarUSERSWEB
  438. VarVAR
  439. VarWEB
  440. VarWEBLIST
  441. VarWEBPREFSTOPIC
  442. VarWIKIAGENTEMAIL
  443. VarWIKIAGENTNAME
  444. VarWIKIHOMEURL
  445. VarWIKINAME
  446. VarWIKIPREFSTOPIC
  447. VarWIKITOOLNAME
  448. VarWIKIUSERNAME
  449. VarWIKIUSERSTOPIC
  450. VarWIKIVERSION
  451. VarWIKIWEBMASTER
  452. VarWIKIWEBMASTERNAME
  453. WYSIWYG
  454. WelcomeGuest
  455. WikiCulture
  456. WikiName
  457. WikiSyntaxSummary
  458. WikiWord
  459. WysiwygPlugin
  460. WysiwygPluginSettings
  461. WysiwygPluginTopicLister

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
  • Anchors and references only work within the current web; they cannot be used to create references between webs.

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 Bad REF: Current topic not in WebOrder 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:

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.

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 Bad REF: Current topic not in WebOrder 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

Bad REF: Current topic not in WebOrder

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

and
%REFTABLE{type=Figure}%
will insert a table like this:
Figure

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

NOTES
  • If you use REFTABLE with the type Section the table will contain a list of all named sections. For example

When using the WebOrder special topic to collect a list of topics into a somewhat "linearized" form (a "book"), it is often very convenient to be able to add navigation buttons to the previous and the next pages as well as to the home page (table of contents). This can be done by adding the %TOCBUTTONS% tag to your pages. For example, you can use it in a template which is included either at the top or the bottom of your pages. The included "view.tocbuttons.tmpl" template (intended to be used with NatSkin) adds the %TOCBUTTONS% tag to the content footer of all pages in the web. To activate it, use "* set SKIN = tocbuttons, nat" in your WebPreferences.

Note that the "Prev", "Home" and "Next" links will be added only for such topics that are listed in the WebOrder special topic, and they will only be inserted when viewing a page, i. e. they will for example not show up when printing such a topic or the whole "book".

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.

  • Include a %TOCCHECK% tag at the end of the table of contents topic.
  • Name all sections. This makes it easier to refer to them by symbolic names rather than trying to REF numbered sections.
Topic revision: r1 - 15 Apr 2011, UnknownUser
This site is powered by FoswikiCopyright © by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding Milan? Send feedback