Package: tcllib, Version: CVS HEAD
docidx_lang_intro -
docidx language introduction
This document is an informal introduction to version 1 of the docidx markup language based on a multitude of examples. After reading this a writer should be ready to understand the two parts of the formal specification, i.e. the docidx language syntax specification and the docidx language command reference.
Each markup command is a Tcl command surrounded by a matching pair of [ and ]. Inside of these delimiters the usual rules for a Tcl command apply with regard to word quotation, nested commands, continuation lines, etc. I.e.
... [key {markup language}] ...
... [manpage thefile \\ {file description}] ...
[index_begin GROUPTITLE TITLE] [index_end]
Not very useful, but valid. This also shows us that all docidx documents consist of only one part where we will 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 above example the command key is used to declare the keyword phrases we wish to be part of the index.
However a truly useful index does not only list the keyword phrases, but will also contain references to documents associated with the keywords. Here is 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 the above example the command manpage is used to insert references to documents, using symbolic file names, with each command belonging to the last key command coming before it.
The other command to insert references is url. In contrast to manpage it uses explicit (possibly format-specific) urls to describe the location of the referenced document. As such this command is intended for the creation of references to external documents which could not be handled in any other way.
Instead of only whitespace the two templating commands include and vset are also allowed, to enable the writer to either set and/or import configuration settings relevant to the table of contents. I.e. it is possible to write
[include FILE] [vset VAR VALUE] [index_begin GROUPTITLE TITLE] ... [index_end]Even more important, these two commands are allowed anywhere where 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.
Our example of their use are the sources 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. ...
To be able to validate a document while writing it, it is also recommended to familiarize oneself with Tclapps' ultra-configurable dtp.
On the other hand, docidx is perfectly suited for the automatic generation from doctools documents, and this is 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.
docidx_intro, docidx_lang_syntax, docidx_lang_cmdref
markup, semantic markup, docidx markup, docidx language, docidx syntax, docidx commands