Tcl Library Source Code


[ Main Table Of Contents | Table Of Contents | Keyword Index | Categories | Modules | Applications ]


doctools::idx - Holding keyword indices

Table Of Contents


package require doctools::idx ?2?
package require Tcl 8.5 9
package require doctools::idx::structure
package require snit

::doctools::idx objectName
objectName method ?arg arg ...?
objectName destroy
objectName key add name
objectName key remove name
objectName key references name
objectName keys
objectName reference add type key name label
objectName reference remove name
objectName reference label name
objectName reference keys name
objectName reference type name
objectName references
objectName title
objectName title text
objectName label
objectName label text
objectName importer
objectName importer object
objectName exporter
objectName exporter object
objectName deserialize = data ?format?
objectName deserialize += data ?format?
objectName serialize ?format?


This package provides a class to contain and programmatically manipulate keyword indices

This is one of the three public pillars the management of keyword indices resides on. The other two pillars are

  1. Exporting keyword indices, and

  2. Importing keyword indices

For information about the Concepts of keyword indices, and their parts, see the same-named section. For information about the data structure which is used to encode keyword indices as values see the section Keyword index serialization format. This is the only format directly known to this class. Conversions from and to any other format are handled by export and import manager objects. These may be attached to a container, but do not have to be, it is merely a convenience.


  1. A keyword index consists of a (possibly empty) set of keywords.

  2. Each keyword in the set is identified by its name.

  3. Each keyword has a (possibly empty) set of references.

  4. A reference can be associated with more than one keyword.

  5. A reference not associated with at least one keyword is not possible however.

  6. Each reference is identified by its target, specified as either an url or symbolic filename, depending on the type of reference (url, or manpage).

  7. The type of a reference (url, or manpage) depends only on the reference itself, and not the keywords it is associated with.

  8. In addition to a type each reference has a descriptive label as well. This label depends only on the reference itself, and not the keywords it is associated with.

A few notes

  1. Manpage references are intended to be used for references to the documents the index is made for. Their target is a symbolic file name identifying the document, and export plugins may replace symbolic with actual file names, if specified.

  2. Url references are intended on the othre hand are inteded to be used for links to anything else, like websites. Their target is an url.

  3. While url and manpage references share a namespace for their identifiers, this should be no problem, given that manpage identifiers are symbolic filenames and as such they should never look like urls, the identifiers for url references.


Package commands

Object command

All objects created by the ::doctools::idx command have the following general form:

Object methods

Keyword index serialization format

Here we specify the format used by the doctools v2 packages to serialize keyword indices as immutable values for transport, comparison, etc.

We distinguish between regular and canonical serializations. While a keyword index may have more than one regular serialization only exactly one of them will be canonical.

Bugs, Ideas, Feedback

This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category doctools of the Tcllib Trackers. Please also report any ideas for enhancements you may have for either package and/or documentation.

When proposing code changes, please provide unified diffs, i.e the output of diff -u.

Note further that attachments are strongly preferred over inlined patches. Attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar.


HTML, TMML, conversion, docidx markup, documentation, formatting, generation, index, json, keyword index, latex, manpage, markup, nroff, parsing, plugin, reference, tcler's wiki, text, url, wiki


Documentation tools


Copyright © 2009 Andreas Kupries