This utility adds tags <indexterm>
to DITA files. You define the terms that you want to include into the index in file indexterm.txt
.
You need the following files.
- DITA files
- indexterm.txt in the working directory
- containedBy.txt in the working directory
To run the utility, you need Python. File names are case sensitive.
DITAtest
folder with sample DITA projectindexterms.txt
sample input file with sample index termscontainedBy.txt
list of tags that can contain the<indexterm>
tag according to DITA rulesindextermGenerator.jpg
Jackson diagram of the program structureIndex_m_all.py
Python code
Log file that contains information about the routines that the program ran and the indexterms that the program added.
indexterm related tags that can contain the indexterm tag are not supported.
- Verify that Python is installed and works from the DITAMAP directory.
To verify:
- Open a command line. For Windows: start
cmd
. For Linux:Ctrl + Alt + t
. For Mac: Terminal. - Navigate to the directory where your DITAMAP sits.
- Type
python --version
.
If you see Python <version>
, Python works properly.
- Navigate to the directory where your DITAMAP file sits.
- Copy
containedBy.txt
to the directory where your DITAMAP file sits. - Copy
Index_m_all.py
to the directory where your DITAMAP file sits. - Create a file
indexterms.txt
in the directory where your DITAMAP file sits. - Write the terms that you want to include in the index in
indexterms.txt
. - Type
python Index_m_all.py
. - OPTIONAL: Change the XML layout in Oxygen Tools > Format and Indent files ...
- The DITAMAP file contains the
<indexlist>
tag. - The DITA files contains tags
<indexterm>
. - The DITA output comprises a document with index.