tags
Compatible Genpage Versions |
Version 1.0.3 and above.
toc( aStartLevel )
toc( aStartLevel aStopLevel)
In the simplest form toc back parses the current content file, replacing all occurences of <H(aLevel+)> with anchor tags and generates a multilevel Table of contents that is inserted wherever a content("TOC") tag is located. It will do this upto and including <H7> tags.
The form with two parameters again replaces all occurences of <H(aLevel+)> with anchor tags and generates a multilevel Table of contents that is inserted wherever a content("TOC") tag is located. However, It will only do this upto and including <H(aStopLevel)> tags.
The caveat is that in order to be sure that all of the content file is preparsed properly before toc() is called, you should place the call to toc() as near to the end of a parsing run as possible (e.g. at the bottom of your template)
Firstly, include the toc.gp recipe by calling <-- _GP_ require("$root/include/toc.gp") --> somewhere in the content.
Place a content("TOC") tag where you want the table of contents to be generated.
As the last entry in your template, include <-- _GP_ toc("2") --> to have a table of contents generated from all <H2> and greater tags with appropriate HREFS and anchors.
Alternatively, as the last entry in your template, include <-- _GP_ toc("2","4") --> to have a multilevel table of contents generated from all <H2>,<H3> and <H4> again with appropriate HREFS and anchors.
Nothing that I can think of.
None known :)
This page generated using Genpage - Version: 1.0.7 on Fri Dec 18 17:45:49 2009
© Joe Vaughan
1999