1dtplite(n)                                                          dtplite(n)
2
3
4
5______________________________________________________________________________
6

NAME

8       dtplite - Lightweight DocTools Markup Processor
9

SYNOPSIS

11       dtplite -o output ?options? format inputfile
12
13       dtplite validate inputfile
14
15       dtplite -o output ?options? format inputdirectory
16
17       dtplite -merge -o output ?options? format inputdirectory
18
19_________________________________________________________________
20

DESCRIPTION

22       The  application  described by this document, dtplite, is the successor
23       to the extremely simple mpexpand. Influenced in  its  functionality  by
24       the  dtp doctools processor it is much more powerful than mpexpand, yet
25       still as easy to use; definitely easier than dtp  with  its  myriad  of
26       subcommands and options.
27
28       dtplite  is based upon the package doctools, like the other two proces‐
29       sors.
30
31   USE CASES
32       dtplite was written with the following three use cases in mind.
33
34       [1]    Validation of a single document, i.e. checking that it was writ‐
35              ten  in valid doctools format. This mode can also be used to get
36              a preliminary version of the formatted output for a single docu‐
37              ment, for display in a browser, nroff, etc., allowing proofread‐
38              ing of the formatting.
39
40       [2]    Generation of the formatted documentation for a single  package,
41              i.e.  all the manpages, plus a table of contents and an index of
42              keywords.
43
44       [3]    An extension of the previous mode of operation, a method for the
45              easy  generation of one documentation tree for several packages,
46              and especially of a unified table of contents and keyword index.
47
48       Beyond the above we also want to make use of the customization features
49       provided  by the HTML formatter. It is not the only format the applica‐
50       tion should be able to generate, but we anticipiate it to be  the  most
51       commonly  used, and it is one of the few which do provide customization
52       hooks.
53
54       We allow the caller to  specify  a  header  string,  footer  string,  a
55       stylesheet,  and  data  for a bar of navigation links at the top of the
56       generated document.  While all can be set as  long  as  the  formatting
57       engine  provides  an appropriate engine parameter (See section OPTIONS)
58       the last two have internal processing which make them specific to HTML.
59
60   COMMAND LINE
61       dtplite -o output ?options? format inputfile
62              This is the form for use case [1]. The options will be explained
63              later, in section OPTIONS.
64
65              path output (in)
66                     This argument specifies where to write the generated doc‐
67                     ument. It can be the path to a file or directory,  or  -.
68                     The last value causes the application to write the gener‐
69                     ated documented to stdout.
70
71                     If the output does not exist then [file dirname  $output]
72                     has  to exist and must be a writable directory.  The gen‐
73                     erated document will be written to a file in that  direc‐
74                     tory,  and the name of that file will be derived from the
75                     inputfile, the format, and the value given to option -ext
76                     (if present).
77
78              (path|handle) format (in)
79                     This argument specifies the formatting engine to use when
80                     processing the input, and thus the format of  the  gener‐
81                     ated  document. See section FORMATS for the possibilities
82                     recognized by the application.
83
84              path inputfile (in)
85                     This argument specifies the path to the file to  process.
86                     It  has  to  exist, must be readable, and written in doc‐
87                     tools format.
88
89
90       dtplite validate inputfile
91              This is a simpler form for use case [1]. The  "validate"  format
92              generates no output at all, only syntax checks are performed. As
93              such the specification of an output file or other options is not
94              necessary and left out.
95
96       dtplite -o output ?options? format inputdirectory
97              This  is the form for use case [2]. It differs from the form for
98              use case [1] by having the input documents specified  through  a
99              directory  instead of a file. The other arguments are identical,
100              except for output, which now has to be the path to  an  existing
101              and writable directory.
102
103              The  input  documents  are all files in inputdirectory or any of
104              its subdirectories which were recognized  by  fileutil::fileType
105              as containing text in doctools format.
106
107       dtplite -merge -o output ?options? format inputdirectory
108              This  is  the  form for use case [3]. The only difference to the
109              form for use case [2] is the additional option -merge.
110
111              Each such call will merge the generated  documents  coming  from
112              processing  the  input  documents under inputdirectory or any of
113              its subdirectories to the files under output. In this manner  it
114              is possible to incrementally build the unified documentation for
115              any number of packages. Note that it is necessary to run through
116              all  the  packages  twice  to get fully correct cross-references
117              (for formats supporting them).
118
119   OPTIONS
120       This section describes all the options available to  the  user  of  the
121       application, with the exception of the options -o and -merge. These two
122       were described already, in section COMMAND LINE.
123
124       -ext string
125              If the name of an output file has to be derived from the name of
126              an  input  file it will use the name of the format as the exten‐
127              sion by default. This option here will  override  this  however,
128              forcing  it  to use string as the file extension. This option is
129              ignored if the name  of  the  output  file  is  fully  specified
130              through option -o.
131
132              When used multiple times only the last definition is relevant.
133
134       -header file
135              This  option can be used if and only if the selected format pro‐
136              vides an engine parameter named "header". It takes the  contents
137              of  the  specified  file  and assign them to that parameter, for
138              whatever use by the engine. The HTML engine will insert the text
139              just  after  the  tag <body>.  If navigation buttons are present
140              (see option -nav below), then the HTML  generated  for  them  is
141              appended  to  the  header data originating here before the final
142              assignment to the parameter.
143
144              When used multiple times only the last definition is relevant.
145
146       -footer file
147              Like -header, except that: Any navigation buttons  are  ignored,
148              the  corresponding  required engine parameter is named "footer",
149              and the data is inserted just before the tag </body>.
150
151              When used multiple times only the last definition is relevant.
152
153       -style file
154              This option can be used if and only if the selected format  pro‐
155              vides  an  engine parameter named "meta". When specified it will
156              generate a  piece  of  HTML  code  declaring  the  file  as  the
157              stylesheet  for  the  generated  document and assign that to the
158              parameter. The HTML engine will insert this inot  the  document,
159              just after the tag <head>.
160
161              When processing an input directory the stylesheet file is copied
162              into the output directory and the generated HTML will  refer  to
163              the  copy, to make the result more self-contained. When process‐
164              ing an input file we have no location to copy the stylesheet  to
165              and so just reference it as specified.
166
167              When used multiple times only the last definition is relevant.
168
169       -nav label url
170              Use  this  option  to  specify a navigation button with label to
171              display and the url to link to. This option can be used  if  and
172              only  if  the selected format provides an engine parameter named
173              "header". The HTML generated for this is  appended  to  whatever
174              data  we  got from option -header before it is inserted into the
175              generated documents.
176
177              When used multiple times all definitions  are  collected  and  a
178              navigation  bar  is  created, with the first definition shown at
179              the left edge and the last definition to the right.
180
181   FORMATS
182       At first the format argument will be treated as a path to  a  tcl  file
183       containing  the  code for the requested formatting engine. The argument
184       will be treated as the name of one of  the  predefined  formats  listed
185       below if and only if the path does not exist.
186
187       Note  a  limitation:  If  treating the format as path to the tcl script
188       implementing the engine was sucessful, then this script has  to  imple‐
189       ment  not only the engine API for doctools, i.e.  doctools_api, but for
190       doctoc_api and docidx_api as well. Otherwise the generation of a  table
191       of contents and of a keyword index will fail.
192
193       List of predefined formats, i.e. as provided by the package doctools:
194
195       nroff  The  processor  generates  *roff output, the standard format for
196              unix manpages.
197
198       html   The processor generates HTML output, for usage in and display by
199              web  browsers.  This  engine is currently the only one providing
200              the various engine parameters required for the  additional  cus‐
201              tomaization of the output.
202
203       tmml   The processor generates TMML output, the Tcl Manpage Markup Lan‐
204              guage, a derivative of XML.
205
206       latex  The processor generates LaTeX output.
207
208       wiki   The processor generates Wiki markup as understood by wikit.
209
210       list   The  processor  extracts  the  information  provided   by   man‐
211              page_begin.   This format is used internally to extract the meta
212              data from which both table of contents  and  keyword  index  are
213              derived from.
214
215       null   The  processor  does not generate any output. This is equivalent
216              to validate.
217
218   DIRECTORY STRUCTURES
219       In this section we describe the directory structures generated  by  the
220       application  under  output when processing all documents in an inputdi‐
221       rectory. In other words, this is only relevant to the use cases [2] and
222       [3].
223
224       [2]    The  following  directory structure is created when processing a
225              single set of input documents.  The file extension used  is  for
226              output  in  HTML,  but that is not relevant to the structure and
227              was just used to have proper file names.
228
229                  output/
230                      toc.html
231                      index.html
232                      files/
233                          path/to/FOO.html
234
235              The last line in the example shows the document generated for  a
236              file FOO located at
237
238                  inputdirectory/path/to/FOO
239
240
241       [3]    When  merging  many packages into a unified set of documents the
242              generated directory structure is a bit deeper:
243
244                  output
245                      .toc
246                      .idx
247                      .tocdoc
248                      .idxdoc
249                      .xrf
250                      toc.html
251                      index.html
252                      FOO1/
253                          ...
254                      FOO2/
255                          toc.html
256                          files/
257                              path/to/BAR.html
258
259              Each of the directories FOO1, ... contains the documents  gener‐
260              ated  for  the package FOO1, ... and follows the structure shown
261              for use case [2]. The only exception is that there  is  no  per-
262              package index.
263
264              The files ".toc", ".idx", and ".xrf" contain the internal status
265              of the whole output and will be read and  updated  by  the  next
266              invokation.  Their contents will not be documented. Remove these
267              files when all packages wanted for the  output  have  been  pro‐
268              cessed, i.e. when the output is complete.
269
270              The  files  ".tocdoc",  and ".idxdoc", are intermediate files in
271              doctoc and docidx markup, respectively, containing the main  ta‐
272              ble  of  contents  and  keyword  index  for the set of documents
273              before their conversion to the chosen output format.   They  are
274              left  in  place, i.e. not deleted, to serve as demonstrations of
275              doctoc and docidx markup.
276

BUGS, IDEAS, FEEDBACK

278       This document, and the application it describes, will undoubtedly  con‐
279       tain  bugs and other problems.  Please report such in the category doc‐
280       tools     of     the     Tcllib     SF     Trackers     [http://source
281       forge.net/tracker/?group_id=12883].   Please  also report any ideas for
282       enhancements you may have for either application and/or documentation.
283

SEE ALSO

285       docidx introduction, doctoc introduction, doctools introduction
286

KEYWORDS

288       HTML, TMML, conversion,  docidx,  doctoc,  doctools,  manpage,  markup,
289       nroff
290
292       Copyright (c) 2004 Andreas Kupries <andreas_kupries@users.sourceforge.net>
293
294
295
296
297Documentation toolbox                 1.0                           dtplite(n)
Impressum