doctools:...rt::docidx(3tcl)
π NAME π
doctools::idx::import::docidx β bestie, it's the docidx import plugin β¨ (yes, the manual page for it is literally called doctools:...rt::docidx(3tcl), we love a mysterious abbreviation π)
πΈ SYNOPSIS πΈ
package require Tcl 8.5 9
package require doctools::idx::import::docidx ?0.2.1?
package require doctools::idx::parse
package require doctools::idx::structure
package require doctools::msgcat
package require doctools::tcl::parse
package require fileutil
package require logger
package require snit
package require struct::list
package require struct::set
package require struct::stack
package require struct::tree
package require treeql
import string configuration
β¨ DESCRIPTION β¨
Okay so, this package? It's the doctools keyword index import plugin, and its whole job is parsing docidx markup. That's it, that's the vibe. π
Real talk though β this is an internal package of doctools. It exists for the higher level management packages that handle keyword indices, especially doctools::idx::import, aka the import manager. She's a supporting character, but a crucial one π«Ά
Can you use it from a regular interpreter? Technically... yes, but only with contortions, and it is not recommended, bestie, I'm begging you π. The proper way to get at this functionality is through the package doctools::idx::import and the import manager objects it hands you. That's the main character route π
π¦ API π¦
The API this package gives you satisfies the spec of the docidx import plugin API version 2. No cap.
import string configurationβ takes the string and parses it as docidx markup encoding a keyword index, in the context of the specified configuration (which is a dictionary, bestie π). The result of the command is the canonical serialization of that keyword index, in the form specified in the section Keyword index serialization format. Periodt.
π [DOCIDX] NOTATION OF KEYWORD INDICES π
The docidx format for keyword indices β also called the docidx markup language β is wayyy too large to cover in a single section, like it's giving encyclopedia energy fr fr. The interested reader should start with the document
- docidx language introduction
and then proceed from there to the formal specifications, i.e. the documents
- docidx language syntax and
- docidx language command reference.
...to get a thorough understanding of the language. That's the reading list, bestie, no shortcuts π
β KEYWORD INDEX SERIALIZATION FORMAT β
Here's where we specify the format the doctools v2 packages use to serialize keyword indices as immutable values for transport, comparison, etc. So they can be passed around without anyone messing with them π§
We distinguish between regular and canonical serializations. A keyword index may have more than one regular serialization, but only exactly one of them will be canonical. The chosen one. The main character. π
π« regular serialization π«
- An index serialization is a nested Tcl dictionary.
- This dictionary holds a single key,
doctools::idx, and its value. This value holds the contents of the index. - The contents of the index are a Tcl dictionary holding the title of the index, a label, and the keywords and references. The relevant keys and their values are
titleβ the value is a string containing the title of the index.labelβ the value is a string containing a label for the index.keywordsβ the value is a Tcl dictionary, using the keywords known to the index as keys. The associated values are lists containing the identifiers of the references associated with that particular keyword.
Any reference identifier used in these lists has to exist as a key in the references dictionary, see the next item for its definition. No orphan identifiers, okay? π«
referencesβ the value is a Tcl dictionary, using the identifiers for the references known to the index as keys. The associated values are 2-element lists containing the type and label of the reference, in this order.
Any key here has to be associated with at least one keyword, i.e. occur in at least one of the reference lists which are the values in the keywords dictionary, see previous item for its definition. Everyone's gotta be linked up π
- The type of a reference can be one of two values,
manpageβ the identifier of the reference is interpreted as symbolic file name, referring to one of the documents the index was made for.urlβ the identifier of the reference is interpreted as an url, referring to some external location, like a website, etc.
π canonical serialization π
The canonical serialization of a keyword index 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 the keyword index. She's one of a kind, obviously π
- 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. - The references listed for each keyword of the index, if any, are listed in ascending dictionary order of their labels, as generated by Tcl's builtin command
lsort -increasing -dict.
π BUGS, IDEAS, FEEDBACK π
This document, and the package it describes, will undoubtedly contain bugs and other problems. It's giving inevitable, ngl π Please report such in the category doctools of the Tcllib Trackers [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 ideas π«Ά
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. That's the move, bestie π
Genuinely though β bugs are not a vibe check anyone wants to fail, so report them fr fr π
π₯ KEYWORDS π₯
deserialization, docidx, doctools, import, index
π CATEGORY π
Text formatter plugin
π COPYRIGHT π
Copyright (c) 2009-2019 Andreas Kupries <andreas_kupries@users.sourceforge.net>
okay that's the whole page bestie, you ate that π
β¨ This lil gem lives in the tcllib source, version 0.2.1, and the manual page answers to doctools:...rt::docidx(3tcl) π Now go parse some docidx, ily π«ΆπΈ
π¦ 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