This plugin generates an index of all the pages included from one master page.
This allows you to put together one huge document for print out
plus a lean index for online browsing without extra maintenance.
Syntax Rules
%INCLUDEINDEX{"MasterPage" headers="n" format="string"}%
This discards everything from the included page,
except:
- Headlines up to given level, the default is 4.
- %INLCUDEd pages, shown as defined by the format string. Default is " * ", i.e. a bullet list.
The format string accepts the same syntax as a
FormattedSearch.
Use this to extract reports about your included pages.
E.g. create a table of current revision information
for all sub documents of a bigger manual:
%INCLUDEINDEX("MyProjectManual" headers="0" format="|[[$topic]] |$rev |$wikiusername |$date |"}%
Examples
%INCLUDEINDEX{"TWikiDocumentation" format=" 0 $topic"}%
for the
TWikiDocumentation of the Athens release yields:
- TWikiImplementationNotes?
- TWikiInstallationGuide
- TWikiUpgradeGuide
- TWikiUserAuthentication
- TWikiAccessControl
- TextFormattingRules
- TWikiVariables
- FileAttachment
- TWikiForms
- TWikiTemplates
- TWikiSkins
- FormattedSearch
- TWikiMetaData
- TWikiPlugins
- TWikiSiteTools
- ManagingTopics
- ManagingWebs
- AppendixFileSystem?
- TWikiHistory
|*Topic* |*Rev*|*Author* |*Date* |
%INCLUDEINDEX{"TWikiDocumentation" headers="0" format="|[[$topic]] | $rev|$wikiusername |$date |"}%
yields:
Include Strategy
In theory, you can continue to write your pages as always
and glue some of them to a bigger document via %INCLUDE.
In practice, you might want to change your strategy a bit,
to make it easier to re-use pages as building blocks for large docs.
The
TWikiDocumentation example is not terribly useful,
because it's just an linear enumeration.
The following rules proved useful in bigger projects:
- Don't put headlines into the topic pages, i.e.:
- Concentrate headlines + includes in one master page
- Title this according to your print-out needs
- Create one index page using this plug-in, add links useful for online surfing, editorial hints etc.
- Use TWiki:Main.ColasNahaboos savemulti Checkpoint function to save the master document without lengthy rendering
- For really huge documents, where you want to print parts/chapters:
- create master page per printable chapter
- include master pages in global print page
- %INCLUDEINDEXes of master pages in index page
You write:
| MyProject: |
MyProjectManual: |
Topic pages: |
---+ My project
%INCLUDEINDEX{...
---++ See also:
- <a href=/cgi-bin/edit/MyProjectManual>edit structure</a>
- <a href=/cgi-bin/pdf/MyProjectManual>Print PDF</a>
|
---+ Foo Topic 1
%INCLUDE{Topic1...
---++ Bar Topic 2
%INCLUDE{Topic2...
---++ Three...
---+ Bar Topic X
%INCLUDE{TopicX... |
Lorem ipsum dolet |
| Lorem ipsum dolet |
. . . |
| Lorem ipsum dolet |
You get:
|
MyProject:
- Foo Topic1
- Bar Topic2
- Three...
- Bar Topic X
See also:
- Edit structure
- Print PDF
|
MyProjectManual
Foo Topic 1
Lorem ipsum dolet
Foo Topic 2
Lorem ipsum dolet
Three...
Lorem ipsum dolet
Bar Topic X
Lorem ipsum dolet
|
Lorem ipsum dolet |
| Lorem ipsum dolet |
. . . |
| Lorem ipsum dolet |
Compare to SectionalEditPlugin
The
TWiki:Plugins/SectionalEditPlugin addresses the same problem
with a completely different approach:
it keeps one (possibly huge) wiki page for your printed document.
The wiki way is emulated by opening small sections for editing.
Advantages of IncludeIndexPlugin:
- You can reference the sub-topics as plain wiki pages
- People can edit the sub-topics independently
- WebChanges etc. work as expected.
- Revision history of sub-documents is easy to track
- Need to render full document only when saving the master doc, but not for sub-topics
Advantages of SectionalEditPlugin:
- More topics mean more names, mean more possiblities to screw up namespace
- Sometimes, it is more convenient to edit many topics in one go
- TWiki (shame!) doesn't support Wiki:WayBackMode (yet), It is very hard to get a previous version of a composite doc other than storing printouts
Other Approaches
TWiki:Codev/FineGrainedAddressing &
TWiki:Codev/NamedIncludeSections
all try to solve the
TWiki:Codev/LongTopicNav igation problem.
They sub-structure topics,
with the aim to handle bigger pages.
This clearly transcends the original wiki concept of small, simple pages.
The IncludeIndexPlugin tries to stick with the idea of lean
content topics
and offload the complex and ugly %FOO{"BAR" random="markup"}% into distinct
TWiki "wizard" pages.
I.e., instead of chopping up long, bulky topics into smaller slices,
build the big structures bottom up.
TWiki's %INCLUDE and skin for print
and this plugin for navigation.
- There are no global settings necessary for this plugin, except
- Set SHORTDESCRIPTION = Generate an index of pages included from a master page.
- Set DEBUG = 0
Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running.
- Download the ZIP file from the Plugin web (see below)
- Unzip
IncludeIndexPlugin.zip in your twiki installation directory. Content:
|
|
| File: |
Description: |
data/TWiki/IncludeIndexPlugin.txt |
Plugin topic |
lib/TWiki/Plugins/IncludeIndexPlugin.pm |
Plugin Perl module |
|
|
|
- Test if the plugin is correctly installed: Between the following two horizontal rulers, the list of topics in the TWikiDocumentation should show up:
-
%INCLUDEINDEX{"TWikiDocumentation" format=" 0 $topic"}%
--
TWiki:Main/PeterKlausner - 11 Jun 2003