1 2[//000000001]: # (dtplite \- Documentation toolbox) 3[//000000002]: # (Generated from file 'dtplite\.man' by tcllib/doctools with format 'markdown') 4[//000000003]: # (Copyright © 2004\-2013 Andreas Kupries <andreas\_kupries@users\.sourceforge\.net>) 5[//000000004]: # (dtplite\(n\) 1\.0\.5 tcllib "Documentation toolbox") 6 7<hr> [ <a href="../../../toc.md">Main Table Of Contents</a> | <a 8href="../../toc.md">Table Of Contents</a> | <a 9href="../../../index.md">Keyword Index</a> | <a 10href="../../../toc0.md">Categories</a> | <a 11href="../../../toc1.md">Modules</a> | <a 12href="../../../toc2.md">Applications</a> ] <hr> 13 14# NAME 15 16dtplite \- Lightweight DocTools Markup Processor 17 18# <a name='toc'></a>Table Of Contents 19 20 - [Table Of Contents](#toc) 21 22 - [Synopsis](#synopsis) 23 24 - [Description](#section1) 25 26 - [USE CASES](#subsection1) 27 28 - [COMMAND LINE](#subsection2) 29 30 - [OPTIONS](#subsection3) 31 32 - [FORMATS](#subsection4) 33 34 - [DIRECTORY STRUCTURES](#subsection5) 35 36 - [Bugs, Ideas, Feedback](#section2) 37 38 - [See Also](#seealso) 39 40 - [Keywords](#keywords) 41 42 - [Category](#category) 43 44 - [Copyright](#copyright) 45 46# <a name='synopsis'></a>SYNOPSIS 47 48[__dtplite__ __\-o__ *output* ?options? *format* *inputfile*](#1) 49[__dtplite__ __validate__ *inputfile*](#2) 50[__dtplite__ __\-o__ *output* ?options? *format* *inputdirectory*](#3) 51[__dtplite__ __\-merge__ __\-o__ *output* ?options? *format* *inputdirectory*](#4) 52 53# <a name='description'></a>DESCRIPTION 54 55The application described by this document, __dtplite__, is the successor to 56the extremely simple __[mpexpand](\.\./modules/doctools/mpexpand\.md)__\. 57Influenced in its functionality by the __dtp__ doctools processor it is much 58more powerful than __[mpexpand](\.\./modules/doctools/mpexpand\.md)__, yet 59still as easy to use; definitely easier than __dtp__ with its myriad of 60subcommands and options\. 61 62__dtplite__ is based upon the package 63__[doctools](\.\./modules/doctools/doctools\.md)__, like the other two 64processors\. 65 66## <a name='subsection1'></a>USE CASES 67 68__dtplite__ was written with the following three use cases in mind\. 69 70 1. Validation of a single document, i\.e\. checking that it was written in valid 71 doctools format\. This mode can also be used to get a preliminary version of 72 the formatted output for a single document, for display in a browser, 73 nroff, etc\., allowing proofreading of the formatting\. 74 75 1. Generation of the formatted documentation for a single package, i\.e\. all 76 the manpages, plus a table of contents and an index of keywords\. 77 78 1. An extension of the previous mode of operation, a method for the easy 79 generation of one documentation tree for several packages, and especially 80 of a unified table of contents and keyword index\. 81 82Beyond the above we also want to make use of the customization features provided 83by the HTML formatter\. It is not the only format the application should be able 84to generate, but we anticipiate it to be the most commonly used, and it is one 85of the few which do provide customization hooks\. 86 87We allow the caller to specify a header string, footer string, a stylesheet, and 88data for a bar of navigation links at the top of the generated document\. While 89all can be set as long as the formatting engine provides an appropriate engine 90parameter \(See section [OPTIONS](#subsection3)\) the last two have internal 91processing which make them specific to HTML\. 92 93## <a name='subsection2'></a>COMMAND LINE 94 95 - <a name='1'></a>__dtplite__ __\-o__ *output* ?options? *format* *inputfile* 96 97 This is the form for use case \[1\]\. The *options* will be explained later, 98 in section [OPTIONS](#subsection3)\. 99 100 * path *output* \(in\) 101 102 This argument specifies where to write the generated document\. It can be 103 the path to a file or directory, or __\-__\. The last value causes the 104 application to write the generated documented to __stdout__\. 105 106 If the *output* does not exist then \[file dirname $output\] has to 107 exist and must be a writable directory\. The generated document will be 108 written to a file in that directory, and the name of that file will be 109 derived from the *inputfile*, the *format*, and the value given to 110 option __\-ext__ \(if present\)\. 111 112 * \(path|handle\) *format* \(in\) 113 114 This argument specifies the formatting engine to use when processing the 115 input, and thus the format of the generated document\. See section 116 [FORMATS](#subsection4) for the possibilities recognized by the 117 application\. 118 119 * path *inputfile* \(in\) 120 121 This argument specifies the path to the file to process\. It has to 122 exist, must be readable, and written in 123 *[doctools](\.\./\.\./\.\./index\.md\#doctools)* format\. 124 125 - <a name='2'></a>__dtplite__ __validate__ *inputfile* 126 127 This is a simpler form for use case \[1\]\. The "validate" format generates no 128 output at all, only syntax checks are performed\. As such the specification 129 of an output file or other options is not necessary and left out\. 130 131 - <a name='3'></a>__dtplite__ __\-o__ *output* ?options? *format* *inputdirectory* 132 133 This is the form for use case \[2\]\. It differs from the form for use case \[1\] 134 by having the input documents specified through a directory instead of a 135 file\. The other arguments are identical, except for *output*, which now 136 has to be the path to an existing and writable directory\. 137 138 The input documents are all files in *inputdirectory* or any of its 139 subdirectories which were recognized by __fileutil::fileType__ as 140 containing text in *[doctools](\.\./\.\./\.\./index\.md\#doctools)* format\. 141 142 - <a name='4'></a>__dtplite__ __\-merge__ __\-o__ *output* ?options? *format* *inputdirectory* 143 144 This is the form for use case \[3\]\. The only difference to the form for use 145 case \[2\] is the additional option __\-merge__\. 146 147 Each such call will merge the generated documents coming from processing the 148 input documents under *inputdirectory* or any of its subdirectories to the 149 files under *output*\. In this manner it is possible to incrementally build 150 the unified documentation for any number of packages\. Note that it is 151 necessary to run through all the packages twice to get fully correct 152 cross\-references \(for formats supporting them\)\. 153 154## <a name='subsection3'></a>OPTIONS 155 156This section describes all the options available to the user of the application, 157with the exception of the options __\-o__ and __\-merge__\. These two were 158described already, in section [COMMAND LINE](#subsection2)\. 159 160 - __\-exclude__ string 161 162 This option specifies an exclude \(glob\) pattern\. Any files identified as 163 manpages to process which match the exclude pattern are ignored\. The option 164 can be provided multiple times, each usage adding an additional pattern to 165 the list of exclusions\. 166 167 - __\-ext__ string 168 169 If the name of an output file has to be derived from the name of an input 170 file it will use the name of the *format* as the extension by default\. 171 This option here will override this however, forcing it to use *string* as 172 the file extension\. This option is ignored if the name of the output file is 173 fully specified through option __\-o__\. 174 175 When used multiple times only the last definition is relevant\. 176 177 - __\-header__ file 178 179 This option can be used if and only if the selected *format* provides an 180 engine parameter named "header"\. It takes the contents of the specified file 181 and assign them to that parameter, for whatever use by the engine\. The HTML 182 engine will insert the text just after the tag __<body>__\. If navigation 183 buttons are present \(see option __\-nav__ below\), then the HTML generated 184 for them is appended to the header data originating here before the final 185 assignment to the parameter\. 186 187 When used multiple times only the last definition is relevant\. 188 189 - __\-footer__ file 190 191 Like __\-header__, except that: Any navigation buttons are ignored, the 192 corresponding required engine parameter is named "footer", and the data is 193 inserted just before the tag __</body>__\. 194 195 When used multiple times only the last definition is relevant\. 196 197 - __\-style__ file 198 199 This option can be used if and only if the selected *format* provides an 200 engine parameter named "meta"\. When specified it will generate a piece of 201 HTML code declaring the *file* as the stylesheet for the generated 202 document and assign that to the parameter\. The HTML engine will insert this 203 inot the document, just after the tag __<head>__\. 204 205 When processing an input directory the stylesheet file is copied into the 206 output directory and the generated HTML will refer to the copy, to make the 207 result more self\-contained\. When processing an input file we have no 208 location to copy the stylesheet to and so just reference it as specified\. 209 210 When used multiple times only the last definition is relevant\. 211 212 - __\-toc__ path 213 214 This option specifies a doctoc file to use for the table of contents instead 215 of generating our own\. 216 217 When used multiple times only the last definition is relevant\. 218 219 - __\-pre\+toc__ label path|text 220 221 - __\-post\+toc__ label path|text 222 223 This option specifies additional doctoc files \(or texts\) to use in the 224 navigation bar\. 225 226 Positioning and handling of multiple uses is like for options 227 __\-prenav__ and __\-postnav__, see below\. 228 229 - __\-nav__ label url 230 231 - __\-prenav__ label url 232 233 Use this option to specify a navigation button with *label* to display and 234 the *url* to link to\. This option can be used if and only if the selected 235 *format* provides an engine parameter named "header"\. The HTML generated 236 for this is appended to whatever data we got from option __\-header__ 237 before it is inserted into the generated documents\. 238 239 When used multiple times all definitions are collected and a navigation bar 240 is created, with the first definition shown at the left edge and the last 241 definition to the right\. 242 243 The url can be relative\. In that case it is assumed to be relative to the 244 main files \(TOC and Keyword index\), and will be transformed for all others 245 to still link properly\. 246 247 - __\-postnav__ label url 248 249 Use this option to specify a navigation button with *label* to display and 250 the *url* to link to\. This option can be used if and only if the selected 251 *format* provides an engine parameter named "header"\. The HTML generated 252 for this is appended to whatever data we got from option __\-header__ 253 before it is inserted into the generated documents\. 254 255 When used multiple times all definitions are collected and a navigation bar 256 is created, with the last definition shown at the right edge and the first 257 definition to the left\. 258 259 The url can be relative\. In that case it is assumed to be relative to the 260 main files \(TOC and Keyword index\), and will be transformed for all others 261 to still link properly\. 262 263## <a name='subsection4'></a>FORMATS 264 265At first the *format* argument will be treated as a path to a tcl file 266containing the code for the requested formatting engine\. The argument will be 267treated as the name of one of the predefined formats listed below if and only if 268the path does not exist\. 269 270*Note a limitation*: If treating the format as path to the tcl script 271implementing the engine was sucessful, then this script has to implement not 272only the engine API for doctools, i\.e\. *doctools\_api*, but for *doctoc\_api* 273and *docidx\_api* as well\. Otherwise the generation of a table of contents and 274of a keyword index will fail\. 275 276List of predefined formats, i\.e\. as provided by the package 277__[doctools](\.\./modules/doctools/doctools\.md)__: 278 279 - __nroff__ 280 281 The processor generates \*roff output, the standard format for unix manpages\. 282 283 - __html__ 284 285 The processor generates HTML output, for usage in and display by web 286 browsers\. This engine is currently the only one providing the various engine 287 parameters required for the additional customaization of the output\. 288 289 - __tmml__ 290 291 The processor generates TMML output, the Tcl Manpage Markup Language, a 292 derivative of XML\. 293 294 - __latex__ 295 296 The processor generates LaTeX output\. 297 298 - __wiki__ 299 300 The processor generates Wiki markup as understood by __wikit__\. 301 302 - __list__ 303 304 The processor extracts the information provided by __manpage\_begin__\. 305 This format is used internally to extract the meta data from which both 306 table of contents and keyword index are derived from\. 307 308 - __null__ 309 310 The processor does not generate any output\. This is equivalent to 311 __validate__\. 312 313## <a name='subsection5'></a>DIRECTORY STRUCTURES 314 315In this section we describe the directory structures generated by the 316application under *output* when processing all documents in an 317*inputdirectory*\. In other words, this is only relevant to the use cases \[2\] 318and \[3\]\. 319 320 - \[2\] 321 322 The following directory structure is created when processing a single set of 323 input documents\. The file extension used is for output in HTML, but that is 324 not relevant to the structure and was just used to have proper file names\. 325 326 output/ 327 toc.html 328 index.html 329 files/ 330 path/to/FOO.html 331 332 The last line in the example shows the document generated for a file FOO 333 located at 334 335 inputdirectory/path/to/FOO 336 337 - \[3\] 338 339 When merging many packages into a unified set of documents the generated 340 directory structure is a bit deeper: 341 342 output 343 .toc 344 .idx 345 .tocdoc 346 .idxdoc 347 .xrf 348 toc.html 349 index.html 350 FOO1/ 351 ... 352 FOO2/ 353 toc.html 354 files/ 355 path/to/BAR.html 356 357 Each of the directories FOO1, \.\.\. contains the documents generated for the 358 package FOO1, \.\.\. and follows the structure shown for use case \[2\]\. The only 359 exception is that there is no per\-package index\. 360 361 The files "\.toc", "\.idx", and "\.xrf" contain the internal status of the 362 whole output and will be read and updated by the next invokation\. Their 363 contents will not be documented\. Remove these files when all packages wanted 364 for the output have been processed, i\.e\. when the output is complete\. 365 366 The files "\.tocdoc", and "\.idxdoc", are intermediate files in doctoc and 367 docidx markup, respectively, containing the main table of contents and 368 keyword index for the set of documents before their conversion to the chosen 369 output format\. They are left in place, i\.e\. not deleted, to serve as 370 demonstrations of doctoc and docidx markup\. 371 372# <a name='section2'></a>Bugs, Ideas, Feedback 373 374This document, and the package it describes, will undoubtedly contain bugs and 375other problems\. Please report such in the category *doctools* of the [Tcllib 376Trackers](http://core\.tcl\.tk/tcllib/reportlist)\. Please also report any ideas 377for enhancements you may have for either package and/or documentation\. 378 379When proposing code changes, please provide *unified diffs*, i\.e the output of 380__diff \-u__\. 381 382Note further that *attachments* are strongly preferred over inlined patches\. 383Attachments can be made by going to the __Edit__ form of the ticket 384immediately after its creation, and then using the left\-most button in the 385secondary navigation bar\. 386 387# <a name='seealso'></a>SEE ALSO 388 389[docidx introduction](\.\./modules/doctools/docidx\_intro\.md), [doctoc 390introduction](\.\./modules/doctools/doctoc\_intro\.md), [doctools 391introduction](\.\./modules/doctools/doctools\_intro\.md) 392 393# <a name='keywords'></a>KEYWORDS 394 395[HTML](\.\./\.\./\.\./index\.md\#html), [TMML](\.\./\.\./\.\./index\.md\#tmml), 396[conversion](\.\./\.\./\.\./index\.md\#conversion), 397[docidx](\.\./\.\./\.\./index\.md\#docidx), [doctoc](\.\./\.\./\.\./index\.md\#doctoc), 398[doctools](\.\./\.\./\.\./index\.md\#doctools), 399[manpage](\.\./\.\./\.\./index\.md\#manpage), 400[markup](\.\./\.\./\.\./index\.md\#markup), [nroff](\.\./\.\./\.\./index\.md\#nroff) 401 402# <a name='category'></a>CATEGORY 403 404Documentation tools 405 406# <a name='copyright'></a>COPYRIGHT 407 408Copyright © 2004\-2013 Andreas Kupries <andreas\_kupries@users\.sourceforge\.net> 409