docidx(n) Documentation tools docidx(n)
NAME
docidx - Create and manipulate docidx converter objects
SYNOPSIS
package require Tcl 8.2
package require doctools::::idx ??1.00??
::::doctools::::idx::::new objectName ?option value...?
::::doctools::::idx::::help
::::doctools::::idx::::search path
objectName option ?arg arg ...?
objectName configure
objectName configure option
objectName configure option value...
objectName cget option
objectName destroy
objectName format text
objectName search path
objectName warnings
DESCRIPTION
This package provides objects which can be used to convert text written
in the doctoc format as specified in docidxfmt into any output format
X, assuming that a formatting engine for X is available and provides
the interface specified in docidxapi.
API
::::doctools::::idx::::new objectName ?option value...?
Creates a new docidx object with an associated global Tcl com-
mand whose name is objectName. This command is explained in full
detail in the sections OBJECT COMAND and OBJECT METHODS.
The list of options and values coming after the name of the
object is used to set the initial configuration of the object.
::::doctools::::idx::::help
This is a pure convenience command for applications which want
to provide their user with a reminder of the available format-
ting commands and their meanings. It returns a string containing
a standard help for this purpose.
::::doctools::::idx::::search path
Whenever the package has to map the name of a format to the file
containing the code for its formatting engine it will search the
file in a number of directories. Three such directories are
declared by the package itself.
However the list is extensible by the user of the package and
the command above is the means to do so. When given a path to an
existing and readable directory it will prepend that directory
to the existing list. This means that the path added last is
searched through first.
An error will be thrown if the path either does not excist, is
not a directory, or is not readable.
OBJECT COMAND
All commands created by ::::doctools::::idx::::new have the following general
form and may be used to invoke various operations on the object they
are associated with.
objectName option ?arg arg ...?
The option and its args determine the exact behavior of the com-
mand. See section OBJECT METHODS for more explanations.
OBJECT METHODS
objectName configure
When called without argument this method returns a list of all
known options and their current values.
objectName configure option
When called with a single argument this method behaves like
cget.
objectName configure option value...
When called with more than one argument the method reconfigures
the object using the options and values given to it.
The legal configuration options are described in section OBJECT
CONFIGURATION.
objectName cget option
This method expects a legal configuration option as argument and
returns the current value of that option for the object the
method was invoked for.
The legal configuration options are described in section OBJECT
CONFIGURATION.
objectName destroy
Destroys the object it is invoked for.
objectName format text
Takes the text and runs it through the configured formatting
engine. The resulting string is returned as the result of this
method. An error will be thrown if no -format was configured for
the object.
The method assumes that the text is in docidx format as speci-
fied in dtformat(n). Errors will be thrown otherwise.
objectName search path
This method extends the per-object list of paths searched for
formatting engines. See also ::::doctools::::idx::::search on how to
extend the global (per-package) list of paths.
The path entered last is searched through first.
objectName warnings
Returns a list containing all the warnings generated by the
engine during the last invocation of method format.
OBJECT CONFIGURATION
All docidx objects understand the following configuration options:
-file file
The argument of this option is stored in the object and can be
retrieved by the formatting engine via the command dtfile (see
dtformatter(n)). Its default value is the empty string.
It will be interpreted as the name of the file containing the
text currently processed by the engine.
-module text
The argument of this option is stored in the object and can be
retrieved by the formatting engine via the command dtmodule
(see dtformatter(n)). Its default value is the empty string.
It will be interpreted as the name of the module the file con-
taining the text currently processed by the engine belongs to.
-format text
The argument of this option specifies the format and thus the
engine to use when converting text via format. Its default value
is the empty string. No formatting is possible if this option is
not set at least once.
The package will immediately try to map the name of the format
to a file containing the implementation of the engine for that
format. An error will be thrown if this mapping fails and a pre-
viously configured format is left untouched.
Section FORMAT MAPING explains how the package looks for engine
implementations.
-deprecated boolean
This option is a flag. If set the object will generate warnings
when formatting a text containing the deprecated markup command
strong Its default value is FALSE. In other words, no warnings
will be generated.
FORMAT MAPING
When trying to map a format name foo to the file containing the imple-
mentation of formatting engine for foo the package will perform the
following algorithm:
[1] If foo is the name of an existing file this file is directly
taken as the implementation.
[2] If not, the list of per-object search paths is searched. For
each directory in the list the package checks if that directory
contains a file "fmt.foo". If yes, that file is taken as the
implementation.
This list of paths is initially empty and can be extended
through the object method search.
[3] If not, the list of global (package) paths is searched. For each
directory in the list the package checks if that directory con-
tains a file "idx.foo". If yes, that file is taken as the imple-
mentation.
This list of paths contains initially one path and can be
extended through the command ::::doctools::::idx::::search.
The initial (standard) path is the sub directory "mpformats" of
the directory the package itself is located in. In other words,
if the package implementation "docidx.tcl" is installed in the
directory "/usr/local/lib/tcllib/doctools" then it will by
default search the directory "/usr/local/lib/tcllib/doc-
tools/mpformats" for format implementations.
[4] The mapping fails.
ENGINES
The package comes with the following predefined formatting engines
html This engine generates HTML markup, for processing by web
browsers and the like.
latex This engine generates output suitable for the latex text proces-
sor coming out of the TeX world.
list This engine retrieves version, section and title of the manpage
from the document. As such it can be used to generate a direc-
tory listing for a set of manpages.
nroff This engine generates nroff output, for processing by nroff, or
groff. The result will be standard man pages as they are known
in the unix world.
null This engine generates no outout at all. This can be used if one
just wants to validate some input.
tmml This engine generates TML markup as specified by Joe English.
The Tcl Manpage Markup Language is a derivate of XML.
wiki This engine generates Wiki markup as understood by Jean Claude
Wippler's wikit application.
SEE ALSO
docidxapi, docidxfmt
KEYWORDS
HTML, TML, conversion, documentation, index, manpage, markup, nroff,
table of contents, toc
COPYRIGHT
Copyright (c) 2003 Andreas Kupries
doctools 1.0 docidx(n)
|