MKINDEX.EXE

Version 2.1a of June 2002
COPYRIGHT (C) 1996-2002 Norbert H. Doerry


1. Description

MKINDEX.EXE is a utility for creating HTML indexes. The indexes are based on the content of two files: a profile file that specifies header and footer information, paths and extensions for the hypertext links, and the title to use for each index; and a data file that specifies the index file, the hypertext linked file, the hypertext display test, and descriptive text.


2. Syntax

MKINDEX.EXE INFILE.TXT -pPROFILE.PAR -?

Where:
          INFILE.TXT = Name of Data File consisting of 4 columns of data
       -pPROFILE.PAR = Name of Profile File
                  -? = Provides the syntax for using mkindex.exe


3. Profile File Format


! The format of the PROFILE.PAR is:
!
! [header]
! Text to print at the top of each INDEX_FILE
! HTML tags can be embedded in this text.
!
! The following fields are defined and can be included anywhere in
! in the header (or footer) section:
!
! &FILENAME is replaced with the filename INDEX_FILE
! without its path or extension.
! &FILEDATE is replaced with the current date in DD-MMM-YY format
! &FILETIME is replaced with the current time in HH:MM:SS format
!
! [footer]
! Text to print at the bottom of each INDEX_FILE
! The same fields as in the header can be used
!
! [commands]
! Title Text to be used for the title of the INDEX_FILE, fields can be used
! Link_Extension .htm
! Link_Path data/
!
! [EOF]
! All lines after the EOF section are ignored

3.1 Title Index
The text specified (Index) is displayed in the title bar of the web browser. Embedded spaces are allowed.

3.2 Link_Extension .HTM
The extension specified (.HTM) is appended to the DATA_FILE filename specified in the Data File. Up to 4 characters can be specified.

3.3 Link_Path data/
The path specified (data/) is added to the beginning of the DATA_FILE filename specified in the Data File.


4. Data File Format

The format of the INFILE.TXT is:

Four columns separated by a space or tab:

   column 1:  INDEX_FILE:  The name of the index file to write this entry in
   column 2:  DATA_FILE:   The hypertext link for this entry
   column 3:  LINK_TEXT:   The text to print for the hypertext link
   column 4:  INDEX_TEXT:  Text to print after the DATA_FILE hypertext link.  


4.1 INDEX_FILE
This field is the name of the index file (without the .htm extension) that the index entry is to be part of. This field may not contain any embedded spaces or tabs.

4.2 DATA_FILE
This field is the name of the file that the hypertext link will link to in the index file specified by INDEX_FILE. The value of this field is preceded with the Link_Path and suffixed with the Link_Extension specified in the Profile File. This field may not contain any embedded spaces or tabs.

4.3 LINK_TEXT
This field contains the text displayed for the hypertext link in the index file specified by INDEX_FILE. This field may not contain any embedded spaces or tabs.

4.4 INDEX_TEXT
This field contains text to be displayed after LINK_TEXT in the index file specified by INDEX_FILE. This is the only field that may contain embedded spaces and tabs.


5. Comments

5.1 Additional Command Line Arguments

MKINDEX.EXE INFILE.TXT -pPROFILE.PAR -? -d

Where:
          INFILE.TXT = Name of Data File consisting of 4 columns of data
       -pPROFILE.PAR = Name of Profile File
                  -? = Provides the syntax for using mkindex.exe
                  -d = Set the DEBUG flag to print out internal variables
                       of the program.  Used to find programming errors in
                       MKINDEX.EXE

5.2 This program was written assuming filenames conformed to the old DOS 8.3 format. Long Filenames (filenames greater than 8 characters, or with extensions greater than 3 characters) are currently not supported.

6. Example

The following is a simple example of how to use MKINDEX.EXE:

PROFILE File TEST.PAR:

! TEST.PAR
! All lines starting with ! are ignored
[header]
<H2> &FILENAME </H2>
<PRE>
!
[footer]
</PRE>
<I> Index Created: &FILEDATE &FILETIME </I>
!
[commands]
Title &FILENAME
Link_Extension .htm
Link_Path data/
!
[EOF]

DATA File TEST.TXT:

index_1 file1 FILE1  This is the first File
index_2 file2 FILE2  This is the second File
index_3 file3 FILE3  This is the third File
index_1 file4 FILE4  This is the fourth File
index_2 file5 FILE5  This is the fifth File
index_2 file6 FILE6  This is the sixth File
index_3 file7 FILE7  This is the seventh File
index_1 file8 FILE8  This is the eighth File
index_1 file9 FILE9  This is the ninth File

The following Files are Assumed to already exist:

 data/file1.htm
 data/file2.htm
 data/file3.htm
 data/file4.htm
 data/file5.htm
 data/file6.htm
 data/file7.htm
 data/file8.htm
 data/file9.htm

The following command should be used to create the index files:

mkindex TEST.TXT -pTEST.PAR

This will result in the generation of 3 files: index_1.htm, index_2.htm, and index_3.htm

index_1.htm will appear as follows:



index_1


FILE1 This is the first File
FILE4 This is the fourth File
FILE8 This is the eighth File
FILE9 This is the ninth File


Index Created: 17-Feb-97 20:37:46


The files index_2.htm and index_3.htm will be similar


7. Another Example

The following is another example of how to use MKINDEX.EXE:


mkindex -ptest2.par test2.txt

which results in the following three index files:

A.htm 
B.htm
C.htm


This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.