1docidx_lang_intro(n)          Documentation tools         docidx_lang_intro(n)
2
3
4
5______________________________________________________________________________
6

NAME

8       docidx_lang_intro - docidx language introduction
9

DESCRIPTION

11       This  document  is  an informal introduction to version 1 of the docidx
12       markup language based on a multitude of examples. After reading this  a
13       writer should be ready to understand the two parts of the formal speci‐
14       fication, i.e. the docidx language syntax specification and the  docidx
15       language command reference.
16
17   FUNDAMENTALS
18       While  the  docidx  markup  language  is  quite similar to the doctools
19       markup language, in the broadest terms possible, there is one key  dif‐
20       ference. An index consists essentially only of markup commands, with no
21       plain text interspersed between them, except for whitespace.
22
23       Each markup command is a Tcl command surrounded by a matching pair of [
24       and  ].  Inside  of  these delimiters the usual rules for a Tcl command
25       apply with regard to  word  quotation,  nested  commands,  continuation
26       lines, etc. I.e.
27
28                  ... [key {markup language}] ...
29
30
31
32                ... [manpage thefile \\
33                        {file description}] ...
34
35
36   BASIC STRUCTURE
37       The most simple document which can be written in docidx is
38
39
40                  [index_begin GROUPTITLE TITLE]
41                  [index_end]
42
43
44       Not  very  useful,  but valid. This also shows us that all docidx docu‐
45       ments consist of only one part where we will list all  keys  and  their
46       references.
47
48       A  more  useful  index will contain at least keywords, or short 'keys',
49       i.e. the phrases which were indexed. So:
50
51
52              [index_begin GROUPTITLE TITLE]
53              [key markup]
54              [key {semantic markup}]]
55              [key {docidx markup}]
56              [key {docidx language}]
57              [key {docidx commands}]
58              [index_end]
59
60
61       In the above example the command key is used  to  declare  the  keyword
62       phrases we wish to be part of the index.
63
64       However  a  truly  useful index does not only list the keyword phrases,
65       but will also contain references to documents associated with the  key‐
66       words.  Here  is  a  made-up  index  for all the manpages in the module
67       base64:
68
69
70              [index_begin tcllib/base64 {De- & Encoding}]
71              [key base64]
72              [manpage base64]
73              [key encoding]
74              [manpage base64]
75              [manpage uuencode]
76              [manpage yencode]
77              [key uuencode]
78              [manpage uuencode]
79              [key yEnc]
80              [manpage yencode]
81              [key ydecode]
82              [manpage yencode]
83              [key yencode]
84              [manpage yencode]
85              [index_end]
86
87
88       In the above example the command manpage is used to  insert  references
89       to documents, using symbolic file names, with each command belonging to
90       the last key command coming before it.
91
92       The other command to insert references is url. In contrast  to  manpage
93       it  uses explicit (possibly format-specific) urls to describe the loca‐
94       tion of the referenced document. As such this command is  intended  for
95       the  creation  of  references  to external documents which could not be
96       handled in any other way.
97
98   ADVANCED STRUCTURE
99       In all previous examples we fudged a bit regarding the markup  actually
100       allowed to be used before the index_begin command opening the document.
101
102       Instead of only whitespace the two templating commands include and vset
103       are also allowed, to enable the writer to either set and/or import con‐
104       figuration  settings relevant to the table of contents. I.e. it is pos‐
105       sible to write
106
107
108              [include FILE]
109              [vset VAR VALUE]
110              [index_begin GROUPTITLE TITLE]
111              ...
112              [index_end]
113
114       Even more important, these two commands are allowed  anywhere  where  a
115       markup command is allowed, without regard for any other structure.
116
117
118              [index_begin GROUPTITLE TITLE]
119              [include FILE]
120              [vset VAR VALUE]
121              ...
122              [index_end]
123
124       The  only  restriction  include has to obey is that the contents of the
125       included file must be valid at the place of the inclusion. I.e. a  file
126       included  before  index_begin  may contain only the templating commands
127       vset and include, a file included after a key may contain  only  manape
128       or url references, and other keys, etc.
129
130   ESCAPES
131       Beyond the 6 commands shown so far we have two more available.  However
132       their function is not the marking up of index structure, but the inser‐
133       tion  of characters, namely [ and ].  These commands, lb and rb respec‐
134       tively, are required because our use of [ and ] to bracket markup  com‐
135       mands makes it impossible to directly use [ and ] within the text.
136
137       Our  example  of  their use are the sources of the last sentence in the
138       previous paragraph, with some highlighting added.
139
140
141                ...
142                These commands, [cmd lb] and [cmd lb] respectively, are required
143                because our use of [lb] and [rb] to bracket markup commands makes it
144                impossible to directly use [lb] and [rb] within the text.
145                ...
146
147

FURTHER READING

149       Now that this document has been digested the reader, assumed  to  be  a
150       writer of documentation should be fortified enough to be able to under‐
151       stand the formal docidx language syntax  specification  as  well.  From
152       here  on  out  the docidx language command reference will also serve as
153       the detailed specification and cheat sheet for all  available  commands
154       and their syntax.
155
156       To  be  able to validate a document while writing it, it is also recom‐
157       mended to familiarize oneself with Tclapps' ultra-configurable dtp.
158
159       On the other hand, docidx is perfectly suited for the automatic genera‐
160       tion  from  doctools documents, and this is the route Tcllib's easy and
161       simple dtplite goes, creating an index for a set  of  documents  behind
162       the scenes, without the writer having to do so on their own.
163

BUGS, IDEAS, FEEDBACK

165       This  document,  and the package it describes, will undoubtedly contain
166       bugs and other problems.  Please report such in the  category  doctools
167       of  the Tcllib Trackers [http://core.tcl.tk/tcllib/reportlist].  Please
168       also report any ideas for enhancements you may have for either  package
169       and/or documentation.
170
171       When proposing code changes, please provide unified diffs, i.e the out‐
172       put of diff -u.
173
174       Note further that  attachments  are  strongly  preferred  over  inlined
175       patches.  Attachments  can  be  made  by  going to the Edit form of the
176       ticket immediately after its creation, and  then  using  the  left-most
177       button in the secondary navigation bar.
178

SEE ALSO

180       docidx_intro, docidx_lang_cmdref, docidx_lang_syntax
181

KEYWORDS

183       docidx commands, docidx language, docidx markup, docidx syntax, markup,
184       semantic markup
185

CATEGORY

187       Documentation tools
188
190       Copyright (c) 2007-2009 Andreas Kupries <andreas_kupries@users.sourceforge.net>
191
192
193
194
195tcllib                                1.0                 docidx_lang_intro(n)
Impressum