Contents 
 Index 
 "TPT User's Guide" 
 < Previous 
 Next > 

Chapter 9 voyant_mt_app.pl

The voyant_mt_app.pl perl program refers to the “main tree (mt)” that plugs into the java table of contents (TOC) applet. This assumes that tree.script files were created for all sub-projects by voyant_nav.pl, which itself is usually called from the 56_nav_script.b shell script.

Using all available and uniquely named tree.script files, this creates a series of master m_tree*.script files which are nested inside a master m_tree.script file.

Overview

This program reads in the project file. Based on the directory names, it makes some assumptions about the names of the tree script files that it expects to see. It steps through all tree script files, reads them in, creates associated master tree script files, and then creates a master tree script file that nests the other tree script files in order.

If an expected tree script file is missing, an error message is output but a working master tree is still generated that ignores the missing mini-TOC.

Note: When the original tree script files were created by voyant_nav.pl, they had no path information in the hyperlinks. This was to make them more general and more easy to use in other directory structures. The tree script files needed to stand on their own and be independent of any resulting directory structure where they might be shared.

Hence, this program must create master script files that include the expected relative paths to the destination topics. The relative path information is again the directory names from the project file.

The Beginnings

The voyant_mt_app.pl perl program started from another home-grown program called voyant_mt_tree.pl. That program used HTML files (tree.html) created for the mini-TOCs from voyant_nav.pl and then generated a series of HTML file. It created expanding/collapsing topics for only the top two levels (chapter and heading1).

Although I liked the HTML files because they are fast to load and simple, it was limited to only expanding the top two levels. As a technical writer, I did not have the time to spend programming a more general solution. Moreover, the multiple HTML which provided “fake” expanding/collapsing topics would soon become unmanageable.

The Extensions

After searching the Internet, an even better solution was found that is more flexible, better, and cheaper than anything I could come up with. It is a Java applet that implements the table of contents.

The Table of Contents Applet implements a tree view interface (similar to the Win95/NT Explorer). The two features that impressed me the most (aside from the inexpensive price for the source code) were the simplicity of the input scripts and the ability to nest scripts.

Refer to www.better-homepage.com/java/java-applets-toc.html.

Once I had convinced management to let me spend the money, it was easy to modify these tools to support the script files.



 "TPT User's Guide" 
 < Previous 
 Next > 


Open-Source tools compliments of Voyant Technologies, Inc. and Glenn C. Maxey.
01/13/2003

TP Tools v2-00-0a

# tpt-hug-02