1doctools::idx::structure(n)   Documentation tools  doctools::idx::structure(n)
2
3
4
5______________________________________________________________________________
6

NAME

8       doctools::idx::structure - Docidx serialization utilities
9

SYNOPSIS

11       package require doctools::idx::structure  ?0.1?
12
13       package require Tcl  8.4
14
15       package require logger
16
17       package require snit
18
19       ::doctools::idx::structure verify serial ?canonvar?
20
21       ::doctools::idx::structure verify-as-canonical serial
22
23       ::doctools::idx::structure canonicalize serial
24
25       ::doctools::idx::structure print serial
26
27       ::doctools::idx::structure merge seriala serialb
28
29______________________________________________________________________________
30

DESCRIPTION

32       This  package provides commands to work with the serializations of key‐
33       word indices as managed by the doctools system  v2,  and  specified  in
34       section Keyword index serialization format.
35
36       This  is  an  internal package of doctools, for use by the higher level
37       packages handling keyword indices and their conversion into and out  of
38       various other formats, like documents written using docidx markup.
39

API

41       ::doctools::idx::structure verify serial ?canonvar?
42              This command verifies that the content of serial is a valid reg‐
43              ular serialization of a keyword index and will throw an error if
44              that  is  not  the  case. The result of the command is the empty
45              string.
46
47              If the argument canonvar is specified it is interpreted  as  the
48              name of a variable in the calling context. This variable will be
49              written to if and only if serial is a valid  regular  serializa‐
50              tion. Its value will be a boolean, with True indicating that the
51              serialization is not only valid, but also canonical. False  will
52              be written for a valid, but non-canonical serialization.
53
54              For  the  specification  of  regular and canonical keyword index
55              serializations see the section Keyword index serialization  for‐
56              mat.
57
58       ::doctools::idx::structure verify-as-canonical serial
59              This  command  verifies  that  the  content of serial is a valid
60              canonical serialization of a keyword index  and  will  throw  an
61              error  if that is not the case. The result of the command is the
62              empty string.
63
64              For the specification of canonical keyword index  serializations
65              see the section Keyword index serialization format.
66
67       ::doctools::idx::structure canonicalize serial
68              This command assumes that the content of serial is a valid regu‐
69              lar serialization of a keyword index and will throw an error  if
70              that is not the case.
71
72              It  will then convert the input into the canonical serialization
73              of the contained keyword index and return it as its  result.  If
74              the input is already canonical it will be returned unchanged.
75
76              For  the  specification  of  regular and canonical keyword index
77              serializations see the section Keyword index serialization  for‐
78              mat.
79
80       ::doctools::idx::structure print serial
81              This  command  assumes that the argument serial contains a valid
82              regular serialization of a keyword index and  returns  a  string
83              containing that index in a human readable form.
84
85              The  exact  format  of  this form is not specified and cannot be
86              relied on for parsing or other machine-based activities.
87
88              For the specification of regular  keyword  index  serializations
89              see the section Keyword index serialization format.
90
91       ::doctools::idx::structure merge seriala serialb
92              This  command  accepts the regular serializations of two keyword
93              indices and uses them to create their union.  The result of  the
94              command  is  the canonical serialization of this unified keyword
95              index.
96
97              Title and label of the resulting index are taken from the  index
98              contained in serialb. The set of keys, references and their con‐
99              nections is the union of the set of keys and references  of  the
100              two inputs.
101
102              For  the  specification  of  regular and canonical keyword index
103              serializations see the section Keyword index serialization  for‐
104              mat.
105

KEYWORD INDEX SERIALIZATION FORMAT

107       Here  we specify the format used by the doctools v2 packages to serial‐
108       ize keyword indices as immutable values for transport, comparison, etc.
109
110       We distinguish between regular and canonical  serializations.  While  a
111       keyword index may have more than one regular serialization only exactly
112       one of them will be canonical.
113
114       regular serialization
115
116              [1]    An index serialization is a nested Tcl dictionary.
117
118              [2]    This dictionary holds a single  key,  doctools::idx,  and
119                     its value. This value holds the contents of the index.
120
121              [3]    The  contents  of  the index are a Tcl dictionary holding
122                     the title of the index, a label,  and  the  keywords  and
123                     references. The relevant keys and their values are
124
125                     title  The  value is a string containing the title of the
126                            index.
127
128                     label  The value is a string containing a label  for  the
129                            index.
130
131                     keywords
132                            The  value is a Tcl dictionary, using the keywords
133                            known to the index as keys. The associated  values
134                            are lists containing the identifiers of the refer‐
135                            ences associated with that particular keyword.
136
137                            Any reference identifier used in these  lists  has
138                            to  exist  as  a key in the references dictionary,
139                            see the next item for its definition.
140
141                     references
142                            The value is a Tcl dictionary, using  the  identi‐
143                            fiers  for  the  references  known to the index as
144                            keys. The associated values  are  2-element  lists
145                            containing the type and label of the reference, in
146                            this order.
147
148                            Any key here has to be associated  with  at  least
149                            one  keyword,  i.e.  occur  in at least one of the
150                            reference lists which are the values in  the  key‐
151                            words  dictionary, see previous item for its defi‐
152                            nition.
153
154              [4]    The type of a reference can be one of two values,
155
156                     manpage
157                            The identifier of the reference is interpreted  as
158                            symbolic  file name, referring to one of the docu‐
159                            ments the index was made for.
160
161                     url    The identifier of the reference is interpreted  as
162                            an  url, referring to some external location, like
163                            a website, etc.
164
165       canonical serialization
166              The canonical serialization of a keyword index has the format as
167              specified  in the previous item, and then additionally satisfies
168              the constraints below, which make it unique among all the possi‐
169              ble serializations of the keyword index.
170
171              [1]    The  keys  found  in  all the nested Tcl dictionaries are
172                     sorted in ascending dictionary  order,  as  generated  by
173                     Tcl's builtin command lsort -increasing -dict.
174
175              [2]    The  references  listed for each keyword of the index, if
176                     any, are listed in ascending dictionary  order  of  their
177                     labels,  as  generated  by  Tcl's  builtin  command lsort
178                     -increasing -dict.
179

BUGS, IDEAS, FEEDBACK

181       This document, and the package it describes, will  undoubtedly  contain
182       bugs  and  other problems.  Please report such in the category doctools
183       of the Tcllib Trackers [http://core.tcl.tk/tcllib/reportlist].   Please
184       also  report any ideas for enhancements you may have for either package
185       and/or documentation.
186
187       When proposing code changes, please provide unified diffs, i.e the out‐
188       put of diff -u.
189
190       Note  further  that  attachments  are  strongly  preferred over inlined
191       patches. Attachments can be made by going  to  the  Edit  form  of  the
192       ticket  immediately  after  its  creation, and then using the left-most
193       button in the secondary navigation bar.
194

KEYWORDS

196       deserialization, docidx, doctools, serialization
197

CATEGORY

199       Documentation tools
200
202       Copyright (c) 2009 Andreas Kupries <andreas_kupries@users.sourceforge.net>
203
204
205
206
207tcllib                                0.1          doctools::idx::structure(n)
Impressum