doctools::...ort::nroff(3tcl)
doctools::toc::export::nroff π
okay bestie, welcome to the manual page for doctools::toc::export::nroff β it lives in the Documentation tools manual, section 3tcl. yes it's one of those internal doctools packages. no, you cannot escape. let's get into it π
β¨ NAME β¨
doctools::toc::export::nroff β nroff export plugin
β¨ SYNOPSIS β¨
package require Tcl 8.5 9
package require doctools::toc::export::nroff ?0.3?
package require doctools::text
package require doctools::nroff::man_macros
export serial configuration
β¨ DESCRIPTION β¨
So this package is the doctools table of contents export plugin for making nroff markup. That's the whole job. She exports. She's a plugin. She's doing great π
She's an internal package of doctools, which means she's meant to be used by the higher-level management packages that handle tables of contents β doctools::toc::export especially, aka the export manager. That's her bestie, that's who she actually hangs out with.
Could you use her straight from a regular interpreter? Technically yes. But it takes contortions π and it is not recommended. The proper way to use this functionality is through the package doctools::toc::export and the export manager objects it provides. periodt.
β¨ API β¨
The API this package gives you satisfies the spec of the doctoc export plugin API version 2. iconic. no cap.
export serial configurationβ This command takes the canonical serialization of a table of contents (the format is in the section ToC serialization format, keep scrolling πΈ), contained in serial, plus the configuration, a dictionary, and it generates nroff markup encoding the table. The created string is then returned as the result of the command. that's it, that's the whole command, she ate π
β¨ CONFIGURATION β¨
The nroff export plugin recognizes the following configuration variables and changes her behaviour as they specify. yes she's listening, she's flexible π¦
string userβ This standard configuration variable holds the name of the user running the process which invoked the export plugin. She puts this info into the provenance comment at the beginning of the generated document. giving credit where credit is due πstring fileβ This standard configuration variable holds the name of the file the table of contents came from. This variable may not be set, or may contain the empty string. If it is defined β meaning set, and not the empty string β she puts this info into the provenance comment at the beginning of the generated document. if it's empty we simply do not speak of it πboolean inlineβ If this flag is set (default), the plugin places the definitions of the man macro set directly into the output. If this flag is not set, the plugin places a reference to the definitions of the man macro set into the output, but not the macro definitions themselves. so: macros in the house, or a lil note saying "macros live there" π
Heads up bestie: this plugin ignores the standard configuration variablesformatandmap, and their values. she said not today π
β¨ TOC SERIALIZATION FORMAT β¨
Here we specify the format the doctools v2 packages use to serialize tables of contents as immutable values β for transport, comparison, etc. fancy π
We distinguish between regular and canonical serializations. A table of contents may have more than one regular serialization, but only exactly one of them will be canonical. one true queen π
regular serialization
- The serialization of any table of contents is a nested Tcl dictionary.
- This dictionary holds a single key,
doctools::toc, and its value. This value holds the contents of the table of contents. - The contents of the table of contents are a Tcl dictionary holding the title of the table of contents, a label, and its elements. The relevant keys and their values are:
titleβ The value is a string containing the title of the table of contents.labelβ The value is a string containing a label for the table of contents.itemsβ The value is a Tcl list holding the elements of the table, in the order they are to be shown.
Each element is a Tcl list holding the type of the item and its description, in this order. Another way to say it: it's a Tcl dictionary holding a single key, the item type, mapped to the item description. iykyk π«
The two legal item types and their descriptions are:
referenceβ This item describes a single entry in the table of contents, referencing a single document. To this end its value is a Tcl dictionary containing an id for the referenced document, a label, and a longer textual description which can be associated with the entry. The relevant keys and their values are:idβ The value is a string containing the id of the document associated with the entry.labelβ The value is a string containing a label for this entry. This string also identifies the entry, and no two entries (references and divisions) in the containing list are allowed to have the same label.descβ The value is a string containing a longer description for this entry.
divisionβ This item describes a group of entries in the table of contents, inducing a hierarchy of entries. To this end its value is a Tcl dictionary containing a label for the group, an optional id to a document for the whole group, and the list of entries in the group. The relevant keys and their values are:idβ The value is a string containing the id of the document associated with the whole group. This key is optional.labelβ The value is a string containing a label for the group. This string also identifies the entry, and no two entries (references and divisions) in the containing list are allowed to have the same label.itemsβ The value is a Tcl list holding the elements of the group, in the order they are to be shown. This list has the same structure as the value for the keyworditemsused to describe the whole table of contents, see above. This closes the recursive definition of the structure, with divisions holding the same type of elements as the whole table of contents, including other divisions. it's divisions all the way down π
canonical serialization
The canonical serialization of a table of contents has the format as specified in the previous item, and then additionally satisfies the constraints below, which make it unique among all the possible serializations of this table of contents.
- The keys found in all the nested Tcl dictionaries are sorted in ascending dictionary order, as generated by Tcl's builtin command
lsort -increasing -dict.
β¨ BUGS, IDEAS, FEEDBACK β¨
ngl, this document β and the package it describes β will undoubtedly contain bugs and other problems π it's giving "we are all just doing our best". Please report such things 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 love a glow-up suggestion π«Ά
When proposing code changes, please provide unified diffs, i.e. the output of diff -u. no vibe-only descriptions, bestie, we need the receipts π§Ύ
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. go get that left-most button, she's right there π
β¨ KEYWORDS β¨
doctools, export, nroff, serialization, table of contents, toc
β¨ CATEGORY β¨
Text formatter plugin
β¨ COPYRIGHT β¨
Copyright (c) 2009-2019 Andreas Kupries <andreas_kupries@users.sourceforge.net>
and that's the whole page, bestie π this was tcllib version 0.3, serving you the doctools::...ort::nroff(3tcl) page β slay, read responsibly, and go generate some nroff β¨π
π¦ where this page comes from
- debian trixie: tcllib 2.0+dfsg-4 Β· Tcl
- 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-2019 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