dtplite(1)
π NAME π
dtplite β Lightweight DocTools Markup Processor β¨
β¨ SYNOPSIS β¨
dtplite -o output ?options? format inputfile
dtplite validate inputfile
dtplite -o output ?options? format inputdirectory
dtplite -merge -o output ?options? format inputdirectory
π¦ DESCRIPTION π¦
okay so, the app this whole page is about is dtplite, and she's the successor to the extremely simple mpexpand. She got influenced in her functionality by the dtp doctools processor, and the result is she's way more powerful than mpexpand but honestly just as easy to use. And definitely easier than dtp with its whole myriad of subcommands and options β like, dtp is giving "30 tabs open and none of them are the right one", no offense. π
And just so we're clear β dtplite is built on the package doctools, same as those other two processors. Bestie family reunion. π«Ά
πΈ USE CASES πΈ
dtplite was written with these three use cases in mind, and she ate every single one:
- Validation of a single document β like, checking that it was written in valid doctools format. This mode can also be used to get a preliminary version of the formatted output for a single document, for display in a browser, nroff, etc., so you can proofread the formatting before committing to the whole thing. iykyk.
- Generation of the formatted documentation for a single package β that's all the manpages, plus a table of contents and an index of keywords. the whole package. she does it. π
- An extension of the previous mode of operation β a method for the easy generation of one documentation tree for several packages, and especially of a unified table of contents and keyword index. queen behavior, honestly. π
Beyond all of that, we also want to make use of the customization features provided by the HTML formatter. It's not the only format the application should be able to generate, but we anticipate it to be the most commonly used one, and it's one of the few that actually provides customization hooks. not everyone has them, and that's fine, we're not judging. π
We allow the caller to specify a header string, a footer string, a stylesheet, and data for a bar of navigation links at the top of the generated document. All of these can be set as long as the formatting engine provides an appropriate engine parameter (see the OPTIONS section, bestie). But the last two? They have internal processing that makes them specific to HTML. so, heads up. π
π COMMAND LINE π
dtplite -o output ?options? format inputfile
This is the form for use case [1]. The options get explained later, down in the OPTIONS section, don't worry.
- path
output(in) β this argument says where to write the generated document. It can be the path to a file, a path to a directory, or just-. And that last value? It makes the application write the generated document straight to stdout. β¨- If the
outputdoes not exist, then[file dirname $output]has to exist and must be a writable directory. The generated document gets written to a file in that directory, and the name of that file is derived from theinputfile, theformat, and the value given to the-extoption (if it's present). got it? got it. π«Ά
- If the
- path|handle
format(in) β this one says which formatting engine to use when processing the input, and therefore what the format of the generated document is gonna be. See the FORMATS section for the possibilities the application recognizes. - path
inputfile(in) β the path to the file to process. It has to exist, must be readable, and must be written in doctools format. no exceptions, bestie.
dtplite validate inputfile
This is the simpler form for use case [1]. The validate format generates no output at all β only syntax checks are performed. So specifying an output file or any other options is just not necessary, and we leave it out. it's giving minimalist. π
dtplite -o output ?options? format inputdirectory
This is the form for use case [2]. It differs from the use case [1] form because the input documents get specified through a directory instead of a file. All the other arguments are identical β except output, which now has to be the path to an existing and writable directory.
The input documents are all files in inputdirectory or any of its subdirectories which were recognized by fileutil::fileType as containing text in doctools format. she goes digging. π
dtplite -merge -o output ?options? format inputdirectory
This is the form for use case [3]. The only difference from the use case [2] form is the extra option -merge. that's it. one little flag. π
Each such call will merge the generated documents coming from processing the input documents under inputdirectory or any of its subdirectories into the files under output. This way it's possible to incrementally build the unified documentation for any number of packages. And ngl, note that it's necessary to run through all the packages twice to get fully correct cross-references (for formats that support them). twice. I said what I said. π
π OPTIONS π
This section describes all the options available to the user of the application β with the exception of -o and -merge, because those two already got described up in the COMMAND LINE section. no repeats, we're efficient here. β¨
-excludestring β this option specifies an exclude (glob) pattern. Any files identified as manpages to process which match the exclude pattern are ignored. The option can be provided multiple times, and each usage adds an additional pattern to the list of exclusions. stack 'em up. π-extstring β if the name of an output file has to be derived from the name of an input file, it uses the name of the format as the extension by default. This option here overrides that, forcing it to use string as the file extension. It is ignored if the name of the output file is fully specified through the-ooption. When used multiple times, only the last definition is relevant. one at a time, bestie.-headerfile β this option can be used if and only if the selected format provides an engine parameter named"header". It takes the contents of the specified file and assigns them to that parameter, for whatever use by the engine. The HTML engine will insert the text just after the tag<body>. If navigation buttons are present (see the-navoption below), then the HTML generated for them gets appended to the header data originating here, before the final assignment to the parameter. When used multiple times, only the last definition is relevant.-footerfile β like-header, except that: any navigation buttons are ignored, the corresponding required engine parameter is named"footer", and the data is inserted just before the tag</body>. When used multiple times, only the last definition is relevant.-stylefile β this option can be used if and only if the selected format provides an engine parameter named"meta". When specified, it generates a piece of HTML code declaring the file as the stylesheet for the generated document, and assigns that to the parameter. The HTML engine will insert this into the document, just after the tag<head>.- When processing an input directory, the stylesheet file gets copied into the output directory, and the generated HTML refers to the copy β to make the result more self-contained. When processing an input file, we have no location to copy the stylesheet to, so it just references it as specified. different vibes, different handling. π¦
- When used multiple times, only the last definition is relevant.
-tocpath β this option specifies a doctoc file to use for the table of contents, instead of generating our own. When used multiple times, only the last definition is relevant.-pre+toclabel path|text-post+toclabel path|text β this option specifies additional doctoc files (or texts) to use in the navigation bar. Positioning and handling of multiple uses is just like for the-prenavand-postnavoptions β see below. π-navlabel url-prenavlabel url β use this option to specify a navigation button with label to display and the url to link to. This option can be used if and only if the selected format provides an engine parameter named"header". The HTML generated for this gets appended to whatever data we got from the-headeroption, before it's inserted into the generated documents.- When used multiple times, all definitions are collected and a navigation bar is created, with the first definition shown at the left edge and the last definition to the right. π
- The url can be relative. In that case it's assumed to be relative to the main files (TOC and Keyword index), and will be transformed for all the others so they still link properly. she adjusts. she's thoughtful like that. π«Ά
-postnavlabel url β use this option to specify a navigation button with label to display and the url to link to. This option can be used if and only if the selected format provides an engine parameter named"header". The HTML generated for this gets appended to whatever data we got from the-headeroption, before it's inserted into the generated documents.- When used multiple times, all definitions are collected and a navigation bar is created, with the last definition shown at the right edge and the first definition to the left. (yes, it's the mirror of
-prenav. iconic.) π - The url can be relative. In that case it's assumed to be relative to the main files (TOC and Keyword index), and will be transformed for all the others so they still link properly.
- When used multiple times, all definitions are collected and a navigation bar is created, with the last definition shown at the right edge and the first definition to the left. (yes, it's the mirror of
π FORMATS π
At first, the format argument gets treated as a path to a tcl file containing the code for the requested formatting engine. The argument will be treated as the name of one of the predefined formats listed below if and only if that path does not exist. so it checks the filesystem first. she's thorough. π
β οΈ Note a limitation: if treating the format as a path to the tcl script implementing the engine was successful, then this script has to implement not only the engine API for doctools (i.e.doctools_api), but fordoctoc_apianddocidx_apias well. Otherwise, the generation of a table of contents and of a keyword index will fail. so like, implement all three, bestie, or it's over. π
List of predefined formats, i.e. as provided by the package doctools:
nroffβ the processor generates*roffoutput, the standard format for unix manpages. old school, still slaying. πhtmlβ the processor generates HTML output, for usage in and display by web browsers. This engine is currently the only one providing the various engine parameters required for the additional customization of the output. she's the special one. β¨tmmlβ the processor spits out TMML, aka the Tcl Manpage Markup Language, which is a whole derivative of XML. yes bestie, XML's cousin πlatexβ the processor gives you LaTeX output. science-y queen β¨wikiβ the processor gives you Wiki markup, exactly the kind thatwikitunderstands. iykyk πlistβ the processor just pulls out the info thatmanpage_beginprovides. this one is internal, lowkey the backbone π¦ it extracts the meta data that both the table of contents and the keyword index get derived from.nullβ the processor generates literally nothing. this is equivalent tovalidate. iconic minimalism, no cap π
π DIRECTORY STRUCTURES π
okay so in this section we're describing the directory structures the application makes under output when it processes all the documents in an inputdirectory. in other words? this is only relevant to use cases [2] and [3]. periodt.
π [2] β one set of input docs
here's the directory structure you get when processing a single set of input documents. the file extension used is for output in HTML, but that's not actually relevant to the structure β it was just used so the file names would be proper. cute, right? πΈ
output/
toc.html
index.html
files/
path/to/FOO.html
and the last line in that example? that's the document generated for a file FOO located at:
inputdirectory/path/to/FOO
π§ [3] β merging many packages
now when you're merging many packages into one unified set of documents, the generated directory structure gets a bit deeper, bestie:
output
.toc
.idx
.tocdoc
.idxdoc
.xrf
toc.html
index.html
FOO1/
...
FOO2/
toc.html
files/
path/to/BAR.html
each of the directories FOO1, ... holds the documents generated for the package FOO1, ... and follows the structure shown for use case [2]. the only exception? there's no per-package index. noted. π
the files .toc, .idx, and .xrf contain the internal status of the whole output, and they'll be read and updated by the next invokation. their contents will not be documented. > remove these files when all packages wanted for the output have been processed, i.e. when the output is complete. don't leave them lying around like old receipts π
the files .tocdoc and .idxdoc are intermediate files in doctoc and docidx markup, respectively, containing the main table of contents and keyword index for the set of documents before their conversion to the chosen output format. they're left in place β i.e. not deleted β to serve as demonstrations of doctoc and docidx markup. little show-and-tell moment, we love that π
π BUGS, IDEAS, FEEDBACK π
this document, and the package it describes, will undoubtedly contain bugs and other problems. no cap, that's just how it is. please report such in the category doctools of the Tcllib Trackers [http://core.tcl.tk/tcllib/reportlist]. and please also report any ideas for enhancements you may have for either the package and/or the documentation β we want them, fr fr π«Ά
when proposing code changes, please provide unified diffs, i.e the output of diff -u. this is not optional, bestie, it's the vibe check.
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. left-most button, remember it π
π SEE ALSO π
docidx introduction, doctoc introduction, doctools introduction
β KEYWORDS β
HTML, TMML, conversion, docidx, doctoc, doctools, manpage, markup, nroff
π CATEGORY π
Documentation tools
π COPYRIGHT π
Copyright (c) 2004-2013 Andreas Kupries <andreas_kupries@users.sourceforge.net>
and that's the whole page, bestie! π«Ά this one came to you from tcllib, version 1.0.5, and it's the dtplite(1) manual β go forth and process those docs, you absolute main character πβ¨
π¦ where this page comes from
- debian bookworm: tcllib 1.21+dfsg-1 Β· BSD
- debian trixie: tcllib 2.0+dfsg-4 Β· Tcl
- ubuntu jammy: tcllib 1.20+dfsg-1 Β· BSD
- ubuntu noble: tcllib 1.21+dfsg-1 Β· BSD
- ubuntu questing: tcllib 2.0+dfsg-4
- ubuntu resolute: tcllib 2.0+dfsg-5 Β· Tcl
- ubuntu stonking: tcllib 2.0+dfsg-6 Β· Tcl
- Copyright (c) 2004-2013 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms