source: stylesheets/lfs-xsl/docbook-xsl-1.78.1/params/glossary.collection.xml@ 58675ce

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 7.5 7.6 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 58675ce was 15c7d39, checked in by Matthew Burgess <matthew@…>, 11 years ago

Update stylesheets to docbook-xsl-1.78.1.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10355 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 10.9 KB
Line 
1<refentry xmlns="http://docbook.org/ns/docbook"
2 xmlns:xlink="http://www.w3.org/1999/xlink"
3 xmlns:xi="http://www.w3.org/2001/XInclude"
4 xmlns:src="http://nwalsh.com/xmlns/litprog/fragment"
5 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6 version="5.0" xml:id="glossary.collection">
7<refmeta>
8<refentrytitle>glossary.collection</refentrytitle>
9<refmiscinfo class="other" otherclass="datatype">string</refmiscinfo>
10</refmeta>
11<refnamediv>
12<refname>glossary.collection</refname>
13<refpurpose>Name of the glossary collection file</refpurpose>
14</refnamediv>
15
16<refsynopsisdiv>
17<src:fragment xml:id="glossary.collection.frag">
18<xsl:param name="glossary.collection"></xsl:param>
19</src:fragment>
20</refsynopsisdiv>
21
22<refsection><info><title>Description</title></info>
23
24<para>Glossaries maintained independently across a set of documents
25are likely to become inconsistent unless considerable effort is
26expended to keep them in sync. It makes much more sense, usually, to
27store all of the glossary entries in a single place and simply
28<quote>extract</quote> the ones you need in each document.</para>
29
30<para>That's the purpose of the
31<parameter>glossary.collection</parameter> parameter. To setup a global
32glossary <quote>database</quote>, follow these steps:</para>
33
34<refsection><info><title>Setting Up the Glossary Database</title></info>
35
36<para>First, create a stand-alone glossary document that contains all of
37the entries that you wish to reference. Make sure that each glossary
38entry has an ID.</para>
39
40<para>Here's an example glossary:</para>
41
42<informalexample>
43<programlisting>
44&lt;?xml version="1.0" encoding="utf-8"?&gt;
45&lt;!DOCTYPE glossary
46 PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
47 "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"&gt;
48&lt;glossary&gt;
49&lt;glossaryinfo&gt;
50&lt;editor&gt;&lt;firstname&gt;Eric&lt;/firstname&gt;&lt;surname&gt;Raymond&lt;/surname&gt;&lt;/editor&gt;
51&lt;title&gt;Jargon File 4.2.3 (abridged)&lt;/title&gt;
52&lt;releaseinfo&gt;Just some test data&lt;/releaseinfo&gt;
53&lt;/glossaryinfo&gt;
54
55&lt;glossdiv&gt;&lt;title&gt;0&lt;/title&gt;
56
57&lt;glossentry&gt;
58&lt;glossterm&gt;0&lt;/glossterm&gt;
59&lt;glossdef&gt;
60&lt;para&gt;Numeric zero, as opposed to the letter `O' (the 15th letter of
61the English alphabet). In their unmodified forms they look a lot
62alike, and various kluges invented to make them visually distinct have
63compounded the confusion. If your zero is center-dotted and letter-O
64is not, or if letter-O looks almost rectangular but zero looks more
65like an American football stood on end (or the reverse), you're
66probably looking at a modern character display (though the dotted zero
67seems to have originated as an option on IBM 3270 controllers). If
68your zero is slashed but letter-O is not, you're probably looking at
69an old-style ASCII graphic set descended from the default typewheel on
70the venerable ASR-33 Teletype (Scandinavians, for whom /O is a letter,
71curse this arrangement). (Interestingly, the slashed zero long
72predates computers; Florian Cajori's monumental "A History of
73Mathematical Notations" notes that it was used in the twelfth and
74thirteenth centuries.) If letter-O has a slash across it and the zero
75does not, your display is tuned for a very old convention used at IBM
76and a few other early mainframe makers (Scandinavians curse &lt;emphasis&gt;this&lt;/emphasis&gt;
77arrangement even more, because it means two of their letters collide).
78Some Burroughs/Unisys equipment displays a zero with a &lt;emphasis&gt;reversed&lt;/emphasis&gt;
79slash. Old CDC computers rendered letter O as an unbroken oval and 0
80as an oval broken at upper right and lower left. And yet another
81convention common on early line printers left zero unornamented but
82added a tail or hook to the letter-O so that it resembled an inverted
83Q or cursive capital letter-O (this was endorsed by a draft ANSI
84standard for how to draw ASCII characters, but the final standard
85changed the distinguisher to a tick-mark in the upper-left corner).
86Are we sufficiently confused yet?&lt;/para&gt;
87&lt;/glossdef&gt;
88&lt;/glossentry&gt;
89
90&lt;glossentry&gt;
91&lt;glossterm&gt;1TBS&lt;/glossterm&gt;
92&lt;glossdef&gt;
93&lt;para role="accidence"&gt;
94&lt;phrase role="pronounce"&gt;&lt;/phrase&gt;
95&lt;phrase role="partsofspeach"&gt;n&lt;/phrase&gt;
96&lt;/para&gt;
97&lt;para&gt;The "One True Brace Style"&lt;/para&gt;
98&lt;glossseealso&gt;indent style&lt;/glossseealso&gt;
99&lt;/glossdef&gt;
100&lt;/glossentry&gt;
101
102&lt;!-- ... --&gt;
103
104&lt;/glossdiv&gt;
105
106&lt;!-- ... --&gt;
107
108&lt;/glossary&gt;</programlisting>
109</informalexample>
110
111</refsection>
112
113<refsection><info><title>Marking Up Glossary Terms</title></info>
114
115<para>That takes care of the glossary database, now you have to get the entries
116into your document. Unlike bibliography entries, which can be empty, creating
117<quote>placeholder</quote> glossary entries would be very tedious. So instead,
118support for <parameter>glossary.collection</parameter> relies on implicit linking.</para>
119
120<para>In your source document, simply use <tag>firstterm</tag> and
121<tag>glossterm</tag> to identify the terms you wish to have included
122in the glossary. The stylesheets assume that you will either set the
123<tag class="attribute">baseform</tag> attribute correctly, or that the
124content of the element exactly matches a term in your glossary.</para>
125
126<para>If you're using a <parameter>glossary.collection</parameter>, don't
127make explicit links on the terms in your document.</para>
128
129<para>So, in your document, you might write things like this:</para>
130
131<informalexample>
132<programlisting>&lt;para&gt;This is dummy text, without any real meaning.
133The point is simply to reference glossary terms like &lt;glossterm&gt;0&lt;/glossterm&gt;
134and the &lt;firstterm baseform="1TBS"&gt;One True Brace Style (1TBS)&lt;/firstterm&gt;.
135The &lt;glossterm&gt;1TBS&lt;/glossterm&gt;, as you can probably imagine, is a nearly
136religious issue.&lt;/para&gt;</programlisting>
137</informalexample>
138
139<para>If you set the <parameter>firstterm.only.link</parameter> parameter,
140only the terms marked with <tag>firstterm</tag> will be links.
141Otherwise, all the terms will be linked.</para>
142
143</refsection>
144
145<refsection><info><title>Marking Up the Glossary</title></info>
146
147<para>The glossary itself has to be identified for the stylesheets. For lack
148of a better choice, the <tag class="attribute">role</tag> is used.
149To identify the glossary as the target for automatic processing, set
150the role to <quote><literal>auto</literal></quote>. The title of this
151glossary (and any other information from the <tag>glossaryinfo</tag>
152that's rendered by your stylesheet) will be displayed, but the entries will
153come from the database.
154</para>
155
156<para>Unfortunately, the glossary can't be empty, so you must put in
157at least one <tag>glossentry</tag>. The content of this entry
158is irrelevant, it will not be rendered:</para>
159
160<informalexample>
161<programlisting>&lt;glossary role="auto"&gt;
162&lt;glossentry&gt;
163&lt;glossterm&gt;Irrelevant&lt;/glossterm&gt;
164&lt;glossdef&gt;
165&lt;para&gt;If you can see this, the document was processed incorrectly. Use
166the &lt;parameter&gt;glossary.collection&lt;/parameter&gt; parameter.&lt;/para&gt;
167&lt;/glossdef&gt;
168&lt;/glossentry&gt;
169&lt;/glossary&gt;</programlisting>
170</informalexample>
171
172<para>What about glossary divisions? If your glossary database has glossary
173divisions <emphasis>and</emphasis> your automatic glossary contains at least
174one <tag>glossdiv</tag>, the automic glossary will have divisions.
175If the <tag>glossdiv</tag> is missing from either location, no divisions
176will be rendered.</para>
177
178<para>Glossary entries (and divisions, if appropriate) in the glossary will
179occur in precisely the order they occur in your database.</para>
180
181</refsection>
182
183<refsection><info><title>Formatting the Document</title></info>
184
185<para>Finally, when you are ready to format your document, simply set the
186<parameter>glossary.collection</parameter> parameter (in either a
187customization layer or directly through your processor's interface) to
188point to your global glossary.</para>
189
190<para>A relative path in the parameter is interpreted in one
191of two ways:</para>
192<orderedlist numeration="loweralpha">
193 <listitem>
194 <para>If the parameter <literal>glossterm.auto.link</literal>
195 is set to zero, then the path is relative to the file containing
196 the empty <tag>glossary</tag> element in the document.</para>
197 </listitem>
198 <listitem>
199 <para>If the parameter <literal>glossterm.auto.link</literal>
200 is set to non-zero, then the path is relative to the file containing
201 the first inline <tag>glossterm</tag> or
202 <tag>firstterm</tag> in the document to be linked.</para>
203 </listitem>
204</orderedlist>
205<para>Once the collection file is opened by the first instance described
206above, it stays open for the current document
207and the relative path is not reinterpreted again.</para>
208
209<para>The stylesheets will format the glossary in your document as if
210all of the entries implicilty referenced appeared there literally.</para>
211</refsection>
212
213<refsection><info><title>Limitations</title></info>
214
215<para>Glossary cross-references <emphasis>within the glossary</emphasis> are
216not supported. For example, this <emphasis>will not</emphasis> work:</para>
217
218<informalexample>
219<programlisting>&lt;glossentry&gt;
220&lt;glossterm&gt;gloss-1&lt;/glossterm&gt;
221&lt;glossdef&gt;&lt;para&gt;A description that references &lt;glossterm&gt;gloss-2&lt;/glossterm&gt;.&lt;/para&gt;
222&lt;glossseealso&gt;gloss-2&lt;/glossseealso&gt;
223&lt;/glossdef&gt;
224&lt;/glossentry&gt;</programlisting>
225</informalexample>
226
227<para>If you put glossary cross-references in your glossary that way,
228you'll get the cryptic error: <computeroutput>Warning:
229glossary.collection specified, but there are 0 automatic
230glossaries</computeroutput>.</para>
231
232<para>Instead, you must do two things:</para>
233
234<orderedlist>
235<listitem>
236<para>Markup your glossary using <tag>glossseealso</tag>:</para>
237
238<informalexample>
239<programlisting>&lt;glossentry&gt;
240&lt;glossterm&gt;gloss-1&lt;/glossterm&gt;
241&lt;glossdef&gt;&lt;para&gt;A description that references &lt;glossterm&gt;gloss-2&lt;/glossterm&gt;.&lt;/para&gt;
242&lt;glossseealso&gt;gloss-2&lt;/glossseealso&gt;
243&lt;/glossdef&gt;
244&lt;/glossentry&gt;</programlisting>
245</informalexample>
246</listitem>
247
248<listitem>
249<para>Make sure there is at least one <tag>glossterm</tag> reference to
250<glossterm>gloss-2</glossterm> <emphasis>in your document</emphasis>. The
251easiest way to do that is probably within a <tag>remark</tag> in your
252automatic glossary:</para>
253
254<informalexample>
255<programlisting>&lt;glossary role="auto"&gt;
256&lt;remark&gt;Make sure there's a reference to &lt;glossterm&gt;gloss-2&lt;/glossterm&gt;.&lt;/remark&gt;
257&lt;glossentry&gt;
258&lt;glossterm&gt;Irrelevant&lt;/glossterm&gt;
259&lt;glossdef&gt;
260&lt;para&gt;If you can see this, the document was processed incorrectly. Use
261the &lt;parameter&gt;glossary.collection&lt;/parameter&gt; parameter.&lt;/para&gt;
262&lt;/glossdef&gt;
263&lt;/glossentry&gt;
264&lt;/glossary&gt;</programlisting>
265</informalexample>
266</listitem>
267</orderedlist>
268</refsection>
269
270</refsection>
271</refentry>
Note: See TracBrowser for help on using the repository browser.