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.
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 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.
1.1.A An example Weborder topic
* [[An Overview of Perl]] 1 [[Getting Started]] 2 [[Natural and Artificial Languages]] 3 AGradeExample 2 [[The Gory Details]] * LexicalTexture
SECTION
macro
name
Subsections may be inserted in any topic using the
SECTIONn
macro,
where n
is the required subsection level. The heading of the section
is taken as all text after the macro up to the end of line. For example,
the heading at the top of this section is marked with
%SECTION1{name="SECTION"}% The =%SECTION= macroNOTES
name
attribute cannot be used to refer to a %SECTION0% macro.
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
.
topic
attribute may be used to generate a table of contents for just one topic.
depth
attribute may be used to set the maximum number of levels to generate.
%TOC%
macro in topics that use TocPlugin. However only sections defined using the standard heading syntax will be visible.
TOCCHECK
macro
%TOCCHECK%macro. 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. 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.
ANCHOR
, REF
and REFTABLE
macros ANCHOR
macro
type name display
The ANCHOR macro 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.3.3. The REFTABLE
macro 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
macro 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 monsterswill 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 tablewill generate: 1.3.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.
REF
macro
type topic name
The REF
macro may be used to refer to an anchor. Anchors are
automatically inserted by SECTION
macros or may be added using the
ANCHOR
macro. For a REF
macro to work, the type of the target must be
known. For example:
See %REF{type="Example" name="WebOrder"}% for more information about WebOrderwill generate: See 1.1.A An example 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 TocPlugin:Reference:NonExistantAnchor not satisfied
REFTABLE
macro
type
The REFTABLE
macro 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:
%REFTABLE{type=Figure}%will insert a table like this:
Figure |
---|
1.3.1.A Here be sea monsters |
REFTABLE
with the type Section
the table will contain a list of all named sections.
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% macro 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%
macro 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".
* [[Top level topic]] * AnotherTopLevelTopicTopLevelTopic 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]] * AnotherTopLevelTopicTopLevelTopic 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.
Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "Install".
If you have any problems, or if the extension isn't available inconfigure
, then you can still install manually from the command-line. See http://foswiki.org/Support/ManuallyInstallingExtensions for more help.
One Line Description: | Table of contents and cross-reference management |
Author: | Foswiki:Main.CrawfordCurrie http://c-dot.co.uk |
Release: | 2.1.1 |
Version: | 11472 (2011-04-15) |
Change History: | |
2.1.1 (15 Apr 2011) | Minor correction on file permissions. |
2.1.0 (23 Mar 2011) | Made compatible with BookmakerPlugin, which it now depends on. Now supports topics in different webs. |
2.0.0 (22 Dec 2009) | Updated for Foswiki |
1.0.3 (20 Apr 2006) | Minor doc update, headings no longer marked up as anchor text (Foswiki:Main.SteffenPoulsen) |
1.0.2 (1 Oct 2001) | Corrected directory naming (no thanks to WindowsME!) |
1.0.1 (23 Sep 2001) | Directories restructured according to Plugin requirements, and turned into a zip file |
1.0.0 (15 Sep 2001) | Initial version. Originally developed for use by Motorola documentation teams. |
Copyright: | © 2001-2002 Motorola. All Rights Reserved. |
© 2008-2011 Crawford Currie http://c-dot.co.uk. | |
License: | GPL (GNU General Public License) |
Home: | http://foswiki.org/Extensions/TocPlugin |
Support: | http://foswiki.org/Support/TocPlugin |