doctools2...troduction(3tcl)
π doctools2toc_introduction β DocTools β Tables of Contents π
okay so bestie, welcome to the Documentation tools corner of the manual, where we're talking about doctoc and honestly? it's giving organized. let's go π
β¨ NAME β¨
doctools2toc_introduction β DocTools β Tables of Contents π
πΈ DESCRIPTION πΈ
doctoc (short for documentation tables of contents, iykyk) is not just one thing β it's a whole set of related-but-different entities that work together so you can create and transform tables of contents for documentation, easily. like a little friend group that actually functions π«Ά
These are:
- A Tcl based language for the semantic markup of a table of contents. Markup is represented by Tcl commands. Beginners should start with the doctoc language introduction. The formal specification is split over two documents β one dealing with the doctoc language syntax, the other a doctoc language command reference. π
- A set of packages for the programmatic manipulation of tables of contents in memory, and their conversion between various formats, reading and writing. The markup language above is one of the formats which can be both read from and written to. π
- The system for the conversion of tables of contents, which is based on a plugin mechanism. For this we have two APIs describing the interface between the packages above and the import/export plugins. π
Which of the more detailed documents are relevant to you depends on your role in the documentation process, bestie:
- A writer of documentation has to understand the markup language itself. A beginner to doctoc should read the more informally written doctoc language introduction first. Having digested this, the formal doctoc language syntax specification should become understandable. A writer experienced with doctoc may only need the doctoc language command reference from time to time to refresh her memory. π
While a document is written the dtp application can be used to validate it, and after completion it also performs the conversion into the chosen system of visual markup β be it *roff, HTML, plain text, wiki, etc. The simpler dtplite application makes internal use of doctoc when handling directories of documentation, automatically generating a proper table of contents for them. β¨
- A processor of documentation written in the doctoc markup language has to know which tools are available for use.
The main tool is the aforementioned dtp application provided by Tcllib. The simpler dtplite does not expose doctoc to the user. At the bottom level, common to both applications, however we find the three packages providing the basic facilities to handle tables of contents β i.e. import from textual formats, programmatic manipulation in memory, and export to textual formats. These are:
doctoools::tocβ Programmatic manipulation of tables of contents in memory. π§doctoools::toc::importβ Import of tables of contents from various textual formats. The set of supported formats is extensible through plugin packages. π₯doctoools::toc::exportβ Export of tables of contents to various textual formats. The set of supported formats is extensible through plugin packages. π€
See also the section Package Overview for an overview of the dependencies between these and other, supporting packages. π
- At last, but not least, plugin writers have to understand the interaction between the import and export packages and their plugins. These APIs are described in the documentation for the two relevant packages, i.e.
doctoools::toc::importdoctoools::toc::export
π¦ RELATED FORMATS π¦
The doctoc format does not stand alone β it has two companion formats, no cap. These are called docidx and doctools, and they are intended for the markup of keyword indices, and of general documentation, respectively. They are described in their own sets of documents, starting at the DocTools - Keyword Indices and the DocTools - General, respectively. π«
π PACKAGE OVERVIEW π
okay so this is the friendship map, and it is iconic. everything below is verbatim because I would never mess with a diagram this precious:
~~~~~~~~~~~ doctools::toc ~~~~~~~~~~~
~~ | ~~
doctools::toc::export ~~~~~~~~~~~~~~~~~ | ~~~~~~~~~~~~~ doctools::toc::import
| | |
+---------------+-------------------------+ | +------------------+---------------+-----------------------+---------------+
| | | | | | | | |
struct:map = | | | = doctools::include struct::map fileutil::paths
| | | | |
doctools::toc::export::<*> | | | doctools::toc::import::<*>
doctoc | | | doctoc, json
json | | | | \
html | | | doctools::toc::parse \
nroff | | | | \
wiki | | | +---------------+ json
text | | | | |
doctools::toc::structure |
|
+-------+---------------+
| |
doctools::html doctools::html::cssdefaults doctools::tcl::parse doctools::msgcat
| |
doctools::text doctools::nroff::man_macros =
|
doctools::msgcat::toc::<*>
c, en, de, fr
(fr == en for now)
~~ Interoperable objects, without actual package dependencies
-- Package dependency, higher requires lower package
= Dynamic dependency through plugin system
<*> Multiple packages following the given form of naming.
the little legend at the bottom is your decoder ring for all those squiggles, dashes and equals signs β read it and it all makes sense, promise π§
π 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 [http://core.tcl.tk/tcllib/reportlist](http://core.tcl.tk/tcllib/reportlist). Please also report any ideas for enhancements you may have for either package and/or documentation. we want the glow-up fr fr β¨
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. π
π SEE ALSO π
doctoc_intro, doctools, doctools2doc_introduction, doctools2idx_introduction, doctools_lang_cmdref, doctools_lang_faq, doctools_lang_intro, doctools_lang_syntax, doctools_plugin_apiref
β KEYWORDS β
contents, conversion, formatting, markup, parsing, plugin, semantic markup, table of contents
π CATEGORY π
Documentation tools
π COPYRIGHT π
Copyright (c) 2009 Andreas Kupries <andreas_kupries@users.sourceforge.net>
and that's the whole page, bestie π«Ά this one lives in tcllib, version 2.0, under the name doctools2...troduction in section 3tcl β tysm for reading, mwah π
ππΈ
π¦ 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) 2009 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