You are here: ChrisWeb » TocPluginTest » TocPlugin

TocPlugin

Sophisticated table of contents generation

Supports the generation of tables of contents, together with symbolic cross-references that operate within and between topics.

Adds a number of new macros:
  • %SECTIONn% - inserts an anchored section header
  • %CONTENTS% - generates a table of contents for a topic or an entire web, with full expansion depth control
  • %REF% - inserts a symbolically named cross-reference URL
  • %ANCHOR% - inserts a symbolically named jump target
  • %TOCBUTTONS% - inserts "Prev", "Home" and "Next" buttons
Example:

screenshot.png

The rest of this topic is written using the plugin, so you will see macros such as %SECTION0% if the plugin is not installed and enabled.

%SECTION1{name="WebOrder"}% Books The plugin depends on the existance of a topic called "WebOrder". This topic is referred to as the "book", and should contain a list of the topics that you want to generate section numbers for. Each topic in the book is allocated a SECTION0 section number i.e. the first topic is section 1, the second is section 2 etc.

The book topic is a simple list - either a bulleted list or a numbered list - and can be created interactively using the Foswiki:Extensions.BookmakerPlugin.

Each entry in the book must be the name of a topic in the current web. This plugin ships with a simple WebOrder, which you can view (but are advised not to change).

e.g. %ANCHOR{type="Example" name="WebOrder",isplay="no"}% An example Weborder topic