docidx_lang_intro(n)
β¨ NAME β¨
docidx_lang_intro β the docidx language introduction, and yes bestie, this is docidx_lang_intro(n) from the Documentation tools manual, come sit with me π
π¦ DESCRIPTION π¦
okay so this doc is a vibe-based, informal intro to version 1 of the docidx markup language, and it teaches you through a whole pile of examples. Like, read this and you're genuinely ready to understand the two parts of the formal spec, which are the docidx language syntax specification and the docidx language command reference. No cap. β¨
πΈ FUNDAMENTALS πΈ
so docidx markup is lowkey similar to doctools markup in the broadest possible terms, but there's one key difference that changes everything: an index is basically only markup commands, with no plain text sprinkled between them β except whitespace. That's it, that's the whole thing. π
every markup command is a Tcl command, wrapped in a matching pair of [ and ]. inside those delimiters the usual rules for a Tcl command apply, about word quotation, nested commands, continuation lines, etc. I.e.
... [key {markup language}] ...
... [manpage thefile \
{file description}] ...
π BASIC STRUCTURE π
the most simple document you can write in docidx is:
[index_begin GROUPTITLE TITLE]
[index_end]
not very useful, but valid π«Ά and it shows us that all docidx documents consist of only one part, where we list all keys and their references.
a more useful index will contain at least keywords, or short 'keys', i.e. the phrases which were indexed. So:
[index_begin GROUPTITLE TITLE]
[key markup]
[key {semantic markup}]]
[key {docidx markup}]
[key {docidx language}]
[key {docidx commands}]
[index_end]
in the example above the command key is used to declare the keyword phrases we want in the index. iconic behaviour honestly.
but a truly useful index doesn't just list keyword phrases β it also has references to documents associated with the keywords. here's a made-up index for all the manpages in the module base64:
[index_begin tcllib/base64 {De- & Encoding}]
[key base64]
[manpage base64]
[key encoding]
[manpage base64]
[manpage uuencode]
[manpage yencode]
[key uuencode]
[manpage uuencode]
[key yEnc]
[manpage yencode]
[key ydecode]
[manpage yencode]
[key yencode]
[manpage yencode]
[index_end]
in that example the command manpage inserts references to documents, using symbolic file names, and each command belongs to the last key command coming before it. β¨
the other command for inserting references is url. in contrast to manpage it uses explicit (possibly format-specific) urls to describe the location of the referenced document. so it's meant for making references to external documents that couldn't be handled any other way. main character energy for real.
π ADVANCED STRUCTURE π
in all the previous examples we fudged a bit about what markup is actually allowed before the index_begin command that opens the document π
instead of only whitespace, the two templating commands include and vset are also allowed, so the writer can set and/or import configuration settings relevant to the table of contents. I.e. it's possible to write:
[include FILE]
[vset VAR VALUE]
[index_begin GROUPTITLE TITLE]
...
[index_end]
even more important: these two commands are allowed anywhere a markup command is allowed, without regard for any other structure.
[index_begin GROUPTITLE TITLE]
[include FILE]
[vset VAR VALUE]
...
[index_end]
the only restriction include has to obey is that the contents of the included file must be valid at the place of the inclusion. I.e. a file included before index_begin may contain only the templating commands vset and include, a file included after a key may contain only manape or url references, and other keys, etc.
π¨ bestie, structure is not a suggestion here. include the wrong thing in the wrong spot and it's not valid, periodt.
π ESCAPES π
beyond the 6 commands shown so far we have two more available. but their function is not marking up index structure β it's the insertion of characters, namely [ and ]. these commands, lb and rb respectively, are required because our use of [ and ] to bracket markup commands makes it impossible to directly use [ and ] within the text. π
our example of their use is the source of the last sentence in the previous paragraph, with some highlighting added.
...
These commands, [cmd lb] and [cmd lb] respectively, are required
because our use of [lb] and [rb] to bracket markup commands makes it
impossible to directly use [lb] and [rb] within the text.
...
π FURTHER READING π
now that you've digested this document, the reader β assumed to be a writer of documentation β should be fortified enough to understand the formal docidx language syntax specification as well. from here on out the docidx language command reference will also serve as the detailed specification and cheat sheet for all available commands and their syntax. obsessed. π
to be able to validate a document while writing it, it's also recommended to familiarize yourself with Tclapps' ultra-configurable dtp.
on the other hand, docidx is perfectly suited for the automatic generation from doctools documents, and that's the route Tcllib's easy and simple dtplite goes, creating an index for a set of documents behind the scenes, without the writer having to do so on their own. we love an automation moment π§
π 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 at http://core.tcl.tk/tcllib/reportlist. please also report any ideas for enhancements you may have for either package and/or documentation. we want them 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 β
docidx_introdocidx_lang_cmdrefdocidx_lang_syntax
π KEYWORDS π
docidx commands, docidx language, docidx markup, docidx syntax, markup, semantic markup
π«Ά CATEGORY π«Ά
Documentation tools
π COPYRIGHT π
Copyright (c) 2007-2009 Andreas Kupries <andreas_kupries@users.sourceforge.net>
and that's the whole page, bestie!! π
this was docidx_lang_intro(n) from tcllib, version 1.0, and yeah it lives under Documentation tools. slay, go write an index, you've got this πβ¨
π¦ where this page comes from
- alpine 3.24: tcl-lib-doc 1.21-r1 Β· BSD-2-Clause
- epel 9: tcllib 1.21-1.el9 Β· BSD
- fedora 43: tcllib 2.0-3.fc43 Β· TCL
- fedora 44: tcllib 2.0-4.fc44 Β· TCL
- nixos 26.05: tcllib 2.0
- nixpkgs unstable: tcllib 2.0
- opensuse-leap 16.0: tcllib 1.21-bp160.1.2 Β· TCL
- Copyright (c) 2007-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