voyant_nav.pl File Reference
Swaps out tagged areas in all HTML files in a given directory.
More...
Go to the source code of this file.
Defines
Functions
Variables
Detailed Description
Swaps out tagged areas in all HTML files in a given directory.
-
Parameters:
-
globe::path |
location to find the HTML files. The name should be terminated with a slash (\). Although the directory_name is the first command line parameter, the true input are the HTML files contained within that directory. |
globe::master_nav_file |
[optional path and] filename for the HTML file to use as the master for information. This file has several specially flagged HTML comment sections that are required. Information from the tagged sections are lifted and placed into the tagged sections of the input HTML files. |
-
Return values:
-
input_html_file |
is modified with new information in the tagged areas. This includes the information in the head, navigation at the top of the body, and copyright information at the bottom of the body. |
_file_list |
is a temporary file with a list of all HTML files in the given directory. |
_index_list |
is a temporary file with extracted index tokens. |
tree.html |
is a temporary file with a mini-TOC (table of contents) for the given book. |
This program does most of the work in creating a comprehensive HTML system that spans the mini-HTML systems generated by Doxygen and Mif2Go (from FrameMaker source). The reason it does most of the work is that it has to read the files anyway.
It started out as a tool just to swap out the header, navigation, and copyright areas. However, as long as it was visiting each and every HTML file in the input directory and "knew" what was in those files and how the files related to one another, this tool was expanded to handle generating a mini-TOC file () and an index file. It:
- Reads in the master file to acquire information from tagged areas.
- Creates a list of HTML files in the input directory.
- Opens each HTML file and swaps out common navigation with that coming from the master file.
Before writing a _temp file (and then copying this back over the original input file) and as it processes the file:
- It creates several hash tables that ultimately determine topic order, topic level in tree, etc.
- It generates a mini-TOC file (tree.html) before finishing.
- It processes object tokens coming from the MS-HTML output of Mif2Go to turn them into index token comments. It also writes these tokens to a temporary file _index_file.
- From the topic hash tables, it generates more index tokens for the _index_file.
-
Limitations and Caveats:
-
In order for this to work correctly, the file names for the chapters have to be named correctly so that they sort into a natural order. This is achieved by having the generation place the same prefix on all HTML files for a given chapter. I chose a two-digit number followed by an underscore. In this manner, all files for a given chapter are grouped together by the prefix. Earlier processing of the files determined which of those topics was the first and last for the chapter.
Rather than passing in variables which can create copies in memory, many items use global variables that are defined in globe.pm. When a variable is known to be global, its name begins with "$globe::". The intent is to facilitate maintenance by having all user-defined tags in one place outside of the program.
This used information that came specifically from our implementation of styles in FrameMaker. In particular, we know what the format names are that are used for chapter headings. The number is picked off of that.
-
Author:
-
Glenn C. Maxey
Definition in file voyant_nav.pl.
Define Documentation
#define globe ::have_dox 0
|
|
#define globe ::have_common_top 0
|
|
#define globe ::have_footer 0
|
|
#define globe ::have_header 0
|
|
#define globe ::entire_file ""
|
|
#define htree_file "tree.html"
|
|
#define script_file "tree.script"
|
|
#define target_prefix "_ggg_"
|
|
Function Documentation
if |
( |
@globe::index_info |
|
) |
|
|
if |
( |
$globe::path |
= ~ /cref/i |
) |
|
|
if |
( |
!&generate_and_step_through_list($_file_list) |
|
) |
|
|
if |
( |
@ |
ARGV, |
|
|
$ |
_arg_inc |
|
) |
|
|
& organize_topic_order |
( |
|
) |
|
|
unless |
( |
open(IN_HTML,$in_file) |
|
) |
|
|
Variable Documentation
Open-Source tools compliments of Voyant Technologies, Inc. and Glenn C. Maxey.
01/13/2003
TP Tools v2-00-0a
# tpt-perl-hcr-02