Skip to content

Commit

Permalink
Reworked documentation and implementation of automatic glossaries
Browse files Browse the repository at this point in the history
  • Loading branch information
ndw committed Jan 31, 2024
1 parent c476e39 commit 7f296ef
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
12 changes: 6 additions & 6 deletions src/guide/xml/ref-functions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -452,20 +452,20 @@ to construct the divisions in an index.</para>
</refnamediv>
<refsection>
<title>Description</title>
<para>Returns all <code>glossentry</code> elements that are targeted by <code>$term</code>,
which must either by a <code>glossterm</code> or a <code>firstterm</code> element. The
<para>Returns all <tag>glossentry</tag> elements that are targeted by <code>$term</code>,
which must either by a <tag>glossterm</tag> or a <tag>firstterm</tag> element. The
internal glossary of the input document is always taken into account. </para>
<para>In the form with only one argument, external glossaries are also taken into account if
they are designated in the input document with a <code>&lt;?db
glossary-collection='<replaceable>URIs</replaceable>'?></code> processing instruction.
In the form with two arguments, you can specify a list of URIs of the external
glossaries.</para>

<para>When there is more than one <code>glossentry</code> found, the result sequence will
<para>When there is more than one <tag>glossentry</tag> found, the result sequence will
start with entries from the internal glossary, if any.</para>
<para>The functions design allows its use indepentend from the xslTNG stylesheets. You can, for
example, integrate it in a Schematron rule that checks whether every <code>glossterm</code>
has exactly one corresponding <code>glossentry</code> while authoring your document. That`s
<para>The functions design allows its use independent from the xslTNG stylesheets. You can, for
example, integrate it in a Schematron rule that checks whether every <tag>glossterm</tag>
has exactly one corresponding <tag>glossentry</tag> while authoring your document. That`s
why the function can't use the <parameter>glossary-collection</parameter> transformation
parameter. </para>
</refsection>
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/expected/glossary.005.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
glossary with three entries, mixed from the internal and the external
glossaries.</p><p>Referencing <span class="firstterm"><a href="#apple">Apple</a></span>,
<span class="glossterm"><a href="#pear">Pear</a></span> and
<span class="glossterm"><a href="#R_g1_ge3">Bloodroot</a></span>.</p><div id="R_g1" class="auto component glossary"><header><h2>Glossary</h2></header><dl class="glossary"><dt id="apple" class="glossentry"><span class="glossterm">Apple</span></dt><dd class="glossdef"><p>An apple is an edible fruit produced by an apple tree (Malus
<span class="glossterm"><a href="#R_g1_ge1">Bloodroot</a></span>.</p><div id="R_g1" class="auto component glossary"><header><h2>Glossary</h2></header><dl class="glossary"><dt id="apple" class="glossentry"><span class="glossterm">Apple</span></dt><dd class="glossdef"><p>An apple is an edible fruit produced by an apple tree (Malus
domestica). Apple trees are cultivated worldwide and are the most
widely grown species in the genus Malus. The tree originated in
Central Asia, where its wild ancestor, Malus sieversii, is still
found today. Apples have been grown for thousands of years in Asia
and Europe and were brought to North America by European
colonists. Apples have religious and mythological significance in
many cultures, including Norse, Greek and European Christian
tradition.</p></dd><dt id="R_g1_ge3" class="glossentry"><span class="glossterm">Bloodroot</span></dt><dd class="glossdef"><p>Sanguinaria canadensis, bloodroot, is a perennial,
tradition.</p></dd><dt id="R_g1_ge1" class="glossentry"><span class="glossterm">Bloodroot</span></dt><dd class="glossdef"><p>Sanguinaria canadensis, bloodroot, is a perennial,
herbaceous flowering plant native to eastern North America. It
is the only species in the genus Sanguinaria, included in the
poppy family Papaveraceae, and is most closely related to
Expand Down
8 changes: 4 additions & 4 deletions src/test/resources/expected/glossary.006.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
<code class="parameter">$glossary-collection</code> transformation
parameter.</p><p>The internal entry has priority and should therefore
cover/overwrite the definition from the external glossary.</p><p>We expect a glossary with four entries, mixed from the internal and the external
glossaries. <ol class="orderedlist" type="1"><li><p><span class="glossterm"><a href="#R_g1_ge1">Apple</a></span> should reference the internal, poetic
definition.</p></li><li><p><span class="glossterm"><a href="#pear">Pear</a></span> references the external definition;</p></li><li><p><span class="glossterm"><a href="#R_g1_ge3">Quince</a></span> references the internal definition.</p></li><li><p><span class="glossterm"><a href="#R_g1_ge4">Bloodroot</a></span> references the internal definition.</p></li></ol></p><div id="R_g1" class="auto component glossary"><header><h2>Glossary</h2></header><dl class="glossary"><dt id="R_g1_ge1" class="glossentry"><span class="glossterm">Apple</span></dt><dd class="glossdef"><p>In early autumn the apple orchards come alive with people and sounds. The
glossaries. <ol class="orderedlist" type="1"><li><p><span class="glossterm"><a href="#R_g1_ge2">Apple</a></span> should reference the internal, poetic
definition.</p></li><li><p><span class="glossterm"><a href="#pear">Pear</a></span> references the external definition;</p></li><li><p><span class="glossterm"><a href="#R_g1_ge1">Quince</a></span> references the internal definition.</p></li><li><p><span class="glossterm"><a href="#R_g1_ge3">Bloodroot</a></span> references the internal definition.</p></li></ol></p><div id="R_g1" class="auto component glossary"><header><h2>Glossary</h2></header><dl class="glossary"><dt id="R_g1_ge2" class="glossentry"><span class="glossterm">Apple</span></dt><dd class="glossdef"><p>In early autumn the apple orchards come alive with people and sounds. The
farmers are picking, peeling, and processing apples into everything from apple
pies to apple sauce. Families swarm the apple trees with their baskets looking
for the best Honeycrisp and Macintosh. The sound of children playing is blended
with the occasional barking dog, or the low rumble of the old Ferguson Orchard
tractor pulling a wagon up and down the rows. </p></dd><dt id="R_g1_ge4" class="glossentry"><span class="glossterm">Bloodroot</span></dt><dd class="glossdef"><p>Sanguinaria canadensis, bloodroot, is a perennial, herbaceous flowering plant
tractor pulling a wagon up and down the rows. </p></dd><dt id="R_g1_ge3" class="glossentry"><span class="glossterm">Bloodroot</span></dt><dd class="glossdef"><p>Sanguinaria canadensis, bloodroot, is a perennial, herbaceous flowering plant
native to eastern North America. It is the only species in the genus
Sanguinaria, included in the poppy family Papaveraceae, and is most closely
related to Eomecon of eastern Asia.</p><p>It is sometimes known as Canada puccoon, bloodwort, redroot, red puccoon, and
Expand All @@ -23,7 +23,7 @@
Pyrus, in the family Rosaceae, bearing the pomaceous
fruit of the same name. Several species of pear are valued for
their edible fruit and juices while others are cultivated as
trees.</p></dd><dt id="R_g1_ge3" class="glossentry"><span class="glossterm">Quince</span></dt><dd class="glossdef"><p>The quince (/ˈkwɪns/; Cydonia oblonga) is the sole member of the genus Cydonia
trees.</p></dd><dt id="R_g1_ge1" class="glossentry"><span class="glossterm">Quince</span></dt><dd class="glossdef"><p>The quince (/ˈkwɪns/; Cydonia oblonga) is the sole member of the genus Cydonia
in the Malinae subtribe (which also contains apples and pears, among other
fruits) of the Rosaceae family. It is a deciduous tree that bears hard, aromatic
bright golden-yellow pome fruit, similar in appearance to a pear. Ripe quince
Expand Down
6 changes: 3 additions & 3 deletions src/test/resources/expected/glossary.007.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
glossary is not empty, and some glossterms have definitions in the internal and external
glossaries. The internal entry has priority and should therefore cover / overwrite the
definition from the external glossary.</p><p>We expect a glossary with three entries, mixed from the internal and the external
glossaries. <ol class="orderedlist" type="1"><li><p><span class="glossterm"><a href="#R_g1_ge1">Apple</a></span> should reference the internal, poetic
definition.</p></li><li><p><span class="glossterm"><a href="#pear">Pear</a></span> references the external definition;</p></li><li><p><span class="glossterm"><a href="#R_g1_ge3">Quince</a></span> references the internal definition.</p></li></ol></p><div id="R_g1" class="auto component glossary"><header><h2>Glossary</h2></header><dl class="glossary"><dt id="R_g1_ge1" class="glossentry"><span class="glossterm">Apple</span></dt><dd class="glossdef"><p>In early autumn the apple orchards come alive with people and sounds. The
glossaries. <ol class="orderedlist" type="1"><li><p><span class="glossterm"><a href="#R_g1_ge2">Apple</a></span> should reference the internal, poetic
definition.</p></li><li><p><span class="glossterm"><a href="#pear">Pear</a></span> references the external definition;</p></li><li><p><span class="glossterm"><a href="#R_g1_ge1">Quince</a></span> references the internal definition.</p></li></ol></p><div id="R_g1" class="auto component glossary"><header><h2>Glossary</h2></header><dl class="glossary"><dt id="R_g1_ge2" class="glossentry"><span class="glossterm">Apple</span></dt><dd class="glossdef"><p>In early autumn the apple orchards come alive with people and sounds. The
farmers are picking, peeling, and processing apples into everything from apple
pies to apple sauce. Families swarm the apple trees with their baskets looking
for the best Honeycrisp and Macintosh. The sound of children playing is blended
Expand All @@ -15,7 +15,7 @@
Pyrus, in the family Rosaceae, bearing the pomaceous
fruit of the same name. Several species of pear are valued for
their edible fruit and juices while others are cultivated as
trees.</p></dd><dt id="R_g1_ge3" class="glossentry"><span class="glossterm">Quince</span></dt><dd class="glossdef"><p>The quince (/ˈkwɪns/; Cydonia oblonga) is the sole member of the genus Cydonia
trees.</p></dd><dt id="R_g1_ge1" class="glossentry"><span class="glossterm">Quince</span></dt><dd class="glossdef"><p>The quince (/ˈkwɪns/; Cydonia oblonga) is the sole member of the genus Cydonia
in the Malinae subtribe (which also contains apples and pears, among other
fruits) of the Rosaceae family. It is a deciduous tree that bears hard, aromatic
bright golden-yellow pome fruit, similar in appearance to a pear. Ripe quince
Expand Down

0 comments on commit 7f296ef

Please sign in to comment.