@pretextbook/pretext-html 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/README.md +160 -0
  2. package/assets/preview-html.xsl +230 -0
  3. package/assets/upstream.json +7 -0
  4. package/assets/xsl/README.md +31 -0
  5. package/assets/xsl/entities.ent +154 -0
  6. package/assets/xsl/extract-asymptote.xsl +68 -0
  7. package/assets/xsl/extract-biblio-csl.xsl +327 -0
  8. package/assets/xsl/extract-datafile.xsl +71 -0
  9. package/assets/xsl/extract-dynamic.xsl +139 -0
  10. package/assets/xsl/extract-identity.xsl +136 -0
  11. package/assets/xsl/extract-interactive.xsl +81 -0
  12. package/assets/xsl/extract-latex-image.xsl +118 -0
  13. package/assets/xsl/extract-mermaid.xsl +58 -0
  14. package/assets/xsl/extract-mom.xsl +63 -0
  15. package/assets/xsl/extract-pg.xsl +2897 -0
  16. package/assets/xsl/extract-prefigure.xsl +157 -0
  17. package/assets/xsl/extract-qrcode.xsl +100 -0
  18. package/assets/xsl/extract-runestone-page-template.xsl +139 -0
  19. package/assets/xsl/extract-sageplot.xsl +166 -0
  20. package/assets/xsl/extract-stack.xsl +56 -0
  21. package/assets/xsl/extract-trace.xsl +134 -0
  22. package/assets/xsl/extract-youtube.xsl +63 -0
  23. package/assets/xsl/html-symbols.xsl +3344 -0
  24. package/assets/xsl/latex/pretext-latex-AIM.xsl +56 -0
  25. package/assets/xsl/latex/pretext-latex-CLP.xsl +148 -0
  26. package/assets/xsl/latex/pretext-latex-chaos.xsl +317 -0
  27. package/assets/xsl/latex/pretext-latex-dyslexic-font.xsl +76 -0
  28. package/assets/xsl/latex/pretext-latex-guide.xsl +104 -0
  29. package/assets/xsl/latex/pretext-latex-texstyle.xsl +862 -0
  30. package/assets/xsl/localizations/README.md +56 -0
  31. package/assets/xsl/localizations/af-ZA.xml +276 -0
  32. package/assets/xsl/localizations/bg-BG.xml +276 -0
  33. package/assets/xsl/localizations/ca-ES.xml +285 -0
  34. package/assets/xsl/localizations/cs-CZ.xml +280 -0
  35. package/assets/xsl/localizations/de-DE.xml +281 -0
  36. package/assets/xsl/localizations/en-US.xml +427 -0
  37. package/assets/xsl/localizations/es-ES.xml +287 -0
  38. package/assets/xsl/localizations/fi-FI.xml +275 -0
  39. package/assets/xsl/localizations/fr-CA.xml +276 -0
  40. package/assets/xsl/localizations/fr-FR.xml +280 -0
  41. package/assets/xsl/localizations/hu-HU.xml +280 -0
  42. package/assets/xsl/localizations/it-IT.xml +276 -0
  43. package/assets/xsl/localizations/ku-CKB.xml +275 -0
  44. package/assets/xsl/localizations/localizations.xml +48 -0
  45. package/assets/xsl/localizations/nl-NL.xml +275 -0
  46. package/assets/xsl/localizations/pt-BR.xml +288 -0
  47. package/assets/xsl/localizations/pt-PT.xml +292 -0
  48. package/assets/xsl/localizations/zh-HANS.xml +269 -0
  49. package/assets/xsl/pretext-assembly.xsl +4795 -0
  50. package/assets/xsl/pretext-basic-html.xsl +86 -0
  51. package/assets/xsl/pretext-beamer.xsl +662 -0
  52. package/assets/xsl/pretext-braille-preprint.xsl +2249 -0
  53. package/assets/xsl/pretext-common.xsl +12018 -0
  54. package/assets/xsl/pretext-dynamic.xsl +65 -0
  55. package/assets/xsl/pretext-epub.xsl +1483 -0
  56. package/assets/xsl/pretext-fo.xsl +4593 -0
  57. package/assets/xsl/pretext-html.xsl +14791 -0
  58. package/assets/xsl/pretext-json-manifest.xsl +150 -0
  59. package/assets/xsl/pretext-jupyter.xsl +868 -0
  60. package/assets/xsl/pretext-latex-classic.xsl +952 -0
  61. package/assets/xsl/pretext-latex-common.xsl +11563 -0
  62. package/assets/xsl/pretext-latex.xsl +47 -0
  63. package/assets/xsl/pretext-litprog.xsl +105 -0
  64. package/assets/xsl/pretext-merge.xsl +41 -0
  65. package/assets/xsl/pretext-numbers.xsl +875 -0
  66. package/assets/xsl/pretext-revealjs.xsl +522 -0
  67. package/assets/xsl/pretext-runestone-fitb.xsl +1233 -0
  68. package/assets/xsl/pretext-runestone-static.xsl +1438 -0
  69. package/assets/xsl/pretext-runestone.xsl +3083 -0
  70. package/assets/xsl/pretext-sage-doctest.xsl +289 -0
  71. package/assets/xsl/pretext-smc.xsl +492 -0
  72. package/assets/xsl/pretext-solution-manual-latex.xsl +323 -0
  73. package/assets/xsl/pretext-text-utilities.xsl +1217 -0
  74. package/assets/xsl/pretext-text.xsl +392 -0
  75. package/assets/xsl/pretext-units.xsl +195 -0
  76. package/assets/xsl/pretext-view-source.xsl +157 -0
  77. package/assets/xsl/pretext-ww-problem-sets.xsl +391 -0
  78. package/assets/xsl/publisher-variables.xsl +4756 -0
  79. package/assets/xsl/support/README.md +22 -0
  80. package/assets/xsl/support/extract-math.xsl +256 -0
  81. package/assets/xsl/support/package-math.xsl +141 -0
  82. package/assets/xsl/support/play-button/README.md +46 -0
  83. package/assets/xsl/support/play-button/play-button.png +0 -0
  84. package/assets/xsl/support/play-button/play-button.svg +3 -0
  85. package/assets/xsl/support/pretext-pg-macros.xsl +110 -0
  86. package/assets/xsl/support/webpack_static_imports.xml +14 -0
  87. package/assets/xsl/tests/README.md +24 -0
  88. package/assets/xsl/tests/null.xml +4 -0
  89. package/assets/xsl/tests/pretext-text-utilities-test.xsl +334 -0
  90. package/assets/xsl/utilities/README.md +31 -0
  91. package/assets/xsl/utilities/author-report.xsl +107 -0
  92. package/assets/xsl/utilities/deprecate-autoname.sed +18 -0
  93. package/assets/xsl/utilities/deprecate-index.sed +33 -0
  94. package/assets/xsl/utilities/fix-deprecations.xsl +663 -0
  95. package/assets/xsl/utilities/pretext-enhanced-source.xsl +112 -0
  96. package/assets/xsl/utilities/report-publisher-variables.xsl +162 -0
  97. package/assets/xsl/xml-to-json.xsl +326 -0
  98. package/assets/xsl/xml-to-string.xsl +328 -0
  99. package/cli.mjs +29 -0
  100. package/dist/cli-C6tfAVvi.js +553 -0
  101. package/dist/cli.d.ts +10 -0
  102. package/dist/cli.js +7 -0
  103. package/dist/index.d.ts +6 -0
  104. package/dist/index.js +10 -0
  105. package/dist/mounts.d.ts +23 -0
  106. package/dist/publication.d.ts +16 -0
  107. package/dist/renderer.d.ts +84 -0
  108. package/dist/sourcemap.d.ts +41 -0
  109. package/dist/xinclude.d.ts +45 -0
  110. package/package.json +52 -0
@@ -0,0 +1,392 @@
1
+ <?xml version='1.0'?>
2
+
3
+ <!--********************************************************************
4
+ Copyright 2018 Robert A. Beezer
5
+
6
+ This file is part of MathBook XML.
7
+
8
+ MathBook XML is free software: you can redistribute it and/or modify
9
+ it under the terms of the GNU General Public License as published by
10
+ the Free Software Foundation, either version 2 or version 3 of the
11
+ License (at your option).
12
+
13
+ MathBook XML is distributed in the hope that it will be useful,
14
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ GNU General Public License for more details.
17
+
18
+ You should have received a copy of the GNU General Public License
19
+ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
20
+ *********************************************************************-->
21
+
22
+ <!-- http://pimpmyxslt.com/articles/entity-tricks-part2/ -->
23
+ <!DOCTYPE xsl:stylesheet [
24
+ <!ENTITY % entities SYSTEM "entities.ent">
25
+ %entities;
26
+ ]>
27
+
28
+ <!-- Identify as a stylesheet -->
29
+ <!-- We choose to not include a default namespace -->
30
+ <!-- (in particular http://www.w3.org/1999/xhtml), -->
31
+ <!-- even if this complicates adding namespaces onto -->
32
+ <!-- derivatives, such as HTML destined for EPUB output -->
33
+ <!-- xmlns="http://www.w3.org/1999/xhtml" -->
34
+ <xsl:stylesheet
35
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
36
+ xmlns:xml="http://www.w3.org/XML/1998/namespace"
37
+ xmlns:exsl="http://exslt.org/common"
38
+ xmlns:date="http://exslt.org/dates-and-times"
39
+ xmlns:str="http://exslt.org/strings"
40
+ extension-element-prefixes="exsl date str"
41
+ >
42
+
43
+ <!-- Standard conversion groundwork -->
44
+ <xsl:import href="./publisher-variables.xsl"/>
45
+ <xsl:import href="./pretext-assembly.xsl"/>
46
+ <xsl:import href="./pretext-common.xsl"/>
47
+
48
+ <!-- This is a conversion to "plain" text. Upon initiation it is mainly -->
49
+ <!-- meant as a foundation for various simple conversions to things like -->
50
+ <!-- doctests or JSON table-of-contents. But it is designed as a "real" -->
51
+ <!-- conversion. But obviously, there are many PreTeXt constructions -->
52
+ <!-- which cannot be realized in text. -->
53
+ <!-- -->
54
+ <!-- Goal is to make it so *no* conversion imports "pretext-common.xsl" -->
55
+ <!-- since some foundational conversion (such as this one) can be the -->
56
+ <!-- basis of the conversion and will import the foundationa one instead.-->
57
+ <!-- -->
58
+ <!-- Initial work might be to implement certain characters as 7-bit -->
59
+ <!-- ASCII and as Unicode, under the control of a switch. For example, -->
60
+ <!-- the "q" element could have dumb generic quotes or smart left and -->
61
+ <!-- right quotes. -->
62
+
63
+ <xsl:output method="text"/>
64
+
65
+ <!-- if chunking, this is the extension of the files produced -->
66
+ <xsl:variable name="file-extension" select="'.txt'"/>
67
+
68
+
69
+ <!-- Entry Template -->
70
+ <!-- Kickstart the process, ignore "docinfo" -->
71
+ <xsl:template match="/">
72
+ <xsl:call-template name="banner-warning">
73
+ <xsl:with-param name="warning">Conversion to simple text is incomplete&#xa;But importing this stylesheet could be helpful for certain purposes&#xa;Override the entry template to make this warning go away</xsl:with-param>
74
+ </xsl:call-template>
75
+ <xsl:apply-templates select="$document-root"/>
76
+ </xsl:template>
77
+
78
+ <!-- TEMPORARY: defined to stop errors, need stubs in -common -->
79
+ <xsl:template name="inline-warning"/>
80
+ <xsl:template name="margin-warning"/>
81
+ <xsl:template match="sage" mode="sage-active-markup"/>
82
+ <xsl:template name="sage-display-markup"/>
83
+
84
+ <!-- ######### -->
85
+ <!-- Divisions -->
86
+ <!-- ######### -->
87
+
88
+ <xsl:template match="part|chapter|section|subsection|subsubsection|exercises|reading-questions|worksheet|handout|glossary|references|solutions">
89
+ <!-- empty line prior -->
90
+ <xsl:text>&#xa;</xsl:text>
91
+ <xsl:apply-templates select="." mode="type-name"/>
92
+ <xsl:text> </xsl:text>
93
+ <xsl:apply-templates select="." mode="number"/>
94
+ <!-- Title is required (or default is supplied) -->
95
+ <xsl:text> </xsl:text>
96
+ <xsl:apply-templates select="." mode="title-full"/>
97
+ <xsl:text>&#xa;</xsl:text>
98
+ <!-- metadata-ish, eg "title", should be killed by default -->
99
+ <xsl:apply-templates select="*"/>
100
+ </xsl:template>
101
+
102
+ <!-- ################ -->
103
+ <!-- Cross-References -->
104
+ <!-- ################ -->
105
+
106
+ <!-- Nothing fancy (like in LaTeX conversion) for -->
107
+ <!-- the number of the target of a cross-reference -->
108
+ <xsl:template match="*" mode="xref-number">
109
+ <xsl:apply-templates select="." mode="number"/>
110
+ </xsl:template>
111
+
112
+ <!-- No good way to link/direct to target, so we just -->
113
+ <!-- parrot the text produced typically for a clickable -->
114
+ <xsl:template match="xref" mode="xref-link">
115
+ <xsl:param name="target"/>
116
+ <xsl:param name="content"/>
117
+
118
+ <xsl:value-of select="$content"/>
119
+ </xsl:template>
120
+
121
+ <!-- Characters -->
122
+
123
+ <!-- Idea: variables from "choose" on $text.encoding variable -->
124
+ <!-- to use cheap ASCII versions (or stand-ins, like [PER-MILLE]), -->
125
+ <!-- versus more realistic Unicode versions -->
126
+
127
+ <!-- N.B. Quotation marks are localized by language in other -->
128
+ <!-- conversions (HTML, LaTeX) and skipped in other conversions -->
129
+ <!-- (braille). They would likely need to use Unicode characters -->
130
+ <!-- like «, » rather than cheap 7-bit ASCII versions, like -->
131
+ <!-- <<, >>. So this would force the issue of a Unicode (8-bit -->
132
+ <!-- and more-than) switch and supporting that. So as of -->
133
+ <!-- 2026-02-18 we are punting. -->
134
+
135
+ <!-- ASCII we just use a regular space -->
136
+ <xsl:template name="nbsp-character">
137
+ <xsl:text> </xsl:text>
138
+ </xsl:template>
139
+
140
+ <xsl:template name="ndash-character">
141
+ <xsl:text>-</xsl:text>
142
+ </xsl:template>
143
+
144
+ <xsl:template name="mdash-character">
145
+ <xsl:text>-</xsl:text>
146
+ </xsl:template>
147
+
148
+ <!-- The abstract template for "mdash" consults a publisher option -->
149
+ <!-- for thin space, or no space, surrounding an em-dash. So the -->
150
+ <!-- "thin-space-character" is needed for that purpose, and does -->
151
+ <!-- not have an associated empty PTX element. -->
152
+
153
+ <!-- ASCII we just use a full space -->
154
+ <xsl:template name="thin-space-character">
155
+ <xsl:text> </xsl:text>
156
+ </xsl:template>
157
+
158
+ <xsl:template match="*" mode="lsq-character">
159
+ <xsl:text>'</xsl:text>
160
+ </xsl:template>
161
+
162
+ <xsl:template match="*" mode="rsq-character">
163
+ <xsl:text>'</xsl:text>
164
+ </xsl:template>
165
+
166
+ <xsl:template match="*" mode="lq-character">
167
+ <xsl:text>"</xsl:text>
168
+ </xsl:template>
169
+
170
+ <xsl:template match="*" mode="rq-character">
171
+ <xsl:text>"</xsl:text>
172
+ </xsl:template>
173
+
174
+ <xsl:template name="ellipsis-character">
175
+ <xsl:text>...</xsl:text>
176
+ </xsl:template>
177
+
178
+ <!-- Math -->
179
+ <!-- Until we think of something better, we just -->
180
+ <!-- bracket raw LaTeX that appears inline -->
181
+ <!-- This can be overridden, if necessary -->
182
+ <xsl:template name="inline-math-wrapper">
183
+ <xsl:param name="math"/>
184
+ <xsl:text>[</xsl:text>
185
+ <xsl:value-of select="$math"/>
186
+ <xsl:text>]</xsl:text>
187
+ </xsl:template>
188
+
189
+ <xsl:template match="p">
190
+ <!-- space with a blank line if not -->
191
+ <!-- first in a structured element -->
192
+ <!-- barring metadata-ish -->
193
+ <xsl:if test="preceding-sibling::*[not(self::title)]">
194
+ <xsl:text>&#xa;</xsl:text>
195
+ </xsl:if>
196
+ <!-- mixed-content -->
197
+ <xsl:apply-templates/>
198
+ <!-- end onto a newline -->
199
+ <xsl:text>&#xa;</xsl:text>
200
+ </xsl:template>
201
+
202
+ <!-- ############ -->
203
+ <!-- Environments -->
204
+ <!-- ############ -->
205
+
206
+ <xsl:template match="&REMARK-LIKE;">
207
+ <!-- space with a blank line if not -->
208
+ <!-- first in a structured element -->
209
+ <!-- barring metadata-ish -->
210
+ <xsl:if test="preceding-sibling::*[not(self::title)]">
211
+ <xsl:text>&#xa;</xsl:text>
212
+ </xsl:if>
213
+ <xsl:apply-templates select="." mode="type-name"/>
214
+ <xsl:text> </xsl:text>
215
+ <xsl:apply-templates select="." mode="number"/>
216
+ <xsl:if test="title">
217
+ <xsl:text> </xsl:text>
218
+ <xsl:apply-templates select="." mode="title-full"/>
219
+ </xsl:if>
220
+ <xsl:text>&#xa;</xsl:text>
221
+ <!-- structured -->
222
+ <xsl:apply-templates select="*"/>
223
+ </xsl:template>
224
+
225
+ <xsl:template match="&EXAMPLE-LIKE;">
226
+ <!-- space with a blank line if not -->
227
+ <!-- first in a structured element -->
228
+ <!-- barring metadata-ish -->
229
+ <xsl:if test="preceding-sibling::*[not(self::title)]">
230
+ <xsl:text>&#xa;</xsl:text>
231
+ </xsl:if>
232
+ <xsl:apply-templates select="." mode="type-name"/>
233
+ <xsl:text> </xsl:text>
234
+ <xsl:apply-templates select="." mode="number"/>
235
+ <xsl:if test="title">
236
+ <xsl:text> </xsl:text>
237
+ <xsl:apply-templates select="." mode="title-full"/>
238
+ </xsl:if>
239
+ <xsl:text>&#xa;</xsl:text>
240
+ <xsl:choose>
241
+ <xsl:when test="statement">
242
+ <xsl:apply-templates select="statement"/>
243
+ <xsl:apply-templates select="&SOLUTION-LIKE;"/>
244
+ </xsl:when>
245
+ <xsl:otherwise>
246
+ <xsl:apply-templates select="*[self::hint|self::answer|self::solution]"/>
247
+ </xsl:otherwise>
248
+ </xsl:choose>
249
+ </xsl:template>
250
+
251
+ <xsl:template match="&THEOREM-LIKE;">
252
+ <!-- space with a blank line if not -->
253
+ <!-- first in a structured element -->
254
+ <!-- barring metadata-ish -->
255
+ <xsl:if test="preceding-sibling::*[not(self::title)]">
256
+ <xsl:text>&#xa;</xsl:text>
257
+ </xsl:if>
258
+ <xsl:apply-templates select="." mode="type-name"/>
259
+ <xsl:text> </xsl:text>
260
+ <xsl:apply-templates select="." mode="number"/>
261
+ <xsl:if test="title">
262
+ <xsl:text> </xsl:text>
263
+ <xsl:apply-templates select="." mode="title-full"/>
264
+ </xsl:if>
265
+ <xsl:text>&#xa;</xsl:text>
266
+ <xsl:choose>
267
+ <xsl:when test="statement">
268
+ <xsl:apply-templates select="statement"/>
269
+ <xsl:apply-templates select="&PROOF-LIKE;"/>
270
+ </xsl:when>
271
+ <xsl:otherwise>
272
+ <xsl:apply-templates select="*"/>
273
+ </xsl:otherwise>
274
+ </xsl:choose>
275
+ </xsl:template>
276
+
277
+ <!-- General-purpose container, we -->
278
+ <!-- do not enforce possibilities -->
279
+ <xsl:template match="statement">
280
+ <!-- structured -->
281
+ <xsl:apply-templates select="*"/>
282
+ </xsl:template>
283
+
284
+ <!-- THEOREM-LIKE only -->
285
+ <xsl:template match="&PROOF-LIKE;">
286
+ <xsl:apply-templates select="." mode="type-name"/>
287
+ <xsl:text>.&#xa;</xsl:text>
288
+ <!-- structured -->
289
+ <xsl:apply-templates select="*"/>
290
+ </xsl:template>
291
+
292
+ <!-- ######### -->
293
+ <!-- Exercises -->
294
+ <!-- ######### -->
295
+
296
+ <xsl:template match="exercise">
297
+ <!-- space with a blank line if not -->
298
+ <!-- first in a structured element -->
299
+ <!-- barring metadata-ish -->
300
+ <xsl:if test="preceding-sibling::*[not(self::title)]">
301
+ <xsl:text>&#xa;</xsl:text>
302
+ </xsl:if>
303
+ <xsl:apply-templates select="." mode="serial-number"/>
304
+ <xsl:text>.</xsl:text>
305
+ <xsl:if test="title">
306
+ <xsl:text> (</xsl:text>
307
+ <xsl:apply-templates select="." mode="title-full"/>
308
+ <xsl:text>)</xsl:text>
309
+ </xsl:if>
310
+ <xsl:text> </xsl:text>
311
+ <xsl:choose>
312
+ <xsl:when test="statement">
313
+ <xsl:apply-templates select="statement"/>
314
+ <xsl:apply-templates select="&SOLUTION-LIKE;"/>
315
+ </xsl:when>
316
+ <xsl:otherwise>
317
+ <xsl:apply-templates select="*[self::hint|self::answer|self::solution]"/>
318
+ </xsl:otherwise>
319
+ </xsl:choose>
320
+ </xsl:template>
321
+
322
+ <xsl:template match="&SOLUTION-LIKE;">
323
+ <xsl:apply-templates select="." mode="type-name"/>
324
+ <xsl:variable name="the-number">
325
+ <xsl:apply-templates select="." mode="non-singleton-number" />
326
+ </xsl:variable>
327
+ <!-- An empty value means element is a singleton -->
328
+ <!-- else the serial number comes through -->
329
+ <xsl:if test="not($the-number = '')">
330
+ <xsl:text> </xsl:text>
331
+ <xsl:apply-templates select="." mode="serial-number" />
332
+ </xsl:if>
333
+ <xsl:text>. </xsl:text>
334
+ <xsl:apply-templates select="*"/>
335
+ <!-- not needed if structured -->
336
+ <xsl:text>&#xa;</xsl:text>
337
+ </xsl:template>
338
+
339
+ <!-- ############### -->
340
+ <!-- Captioned Items -->
341
+ <!-- ############### -->
342
+
343
+ <xsl:template match="figure">
344
+ <!-- space with a blank line if not -->
345
+ <!-- first in a structured element -->
346
+ <!-- barring metadata-ish -->
347
+ <xsl:if test="preceding-sibling::*[not(self::title)]">
348
+ <xsl:text>&#xa;</xsl:text>
349
+ </xsl:if>
350
+ <xsl:apply-templates select="." mode="type-name"/>
351
+ <xsl:text> </xsl:text>
352
+ <xsl:apply-templates select="." mode="number"/>
353
+ <xsl:text>: </xsl:text>
354
+ <xsl:apply-templates select="caption"/>
355
+ <xsl:text>&#xa;</xsl:text>
356
+ </xsl:template>
357
+
358
+ <xsl:template match="caption">
359
+ <!-- mixed-content -->
360
+ <xsl:apply-templates/>
361
+ </xsl:template>
362
+
363
+ <!-- ##### -->
364
+ <!-- Lists -->
365
+ <!-- ##### -->
366
+
367
+ <xsl:template match="ul|ol|dl">
368
+ <xsl:text>&#xa;</xsl:text>
369
+ <xsl:apply-templates select="li"/>
370
+ </xsl:template>
371
+
372
+ <xsl:template match="ol/li">
373
+ <xsl:apply-templates select="." mode="serial-number"/>
374
+ <xsl:text>. </xsl:text>
375
+ <xsl:apply-templates/>
376
+ <xsl:text>&#xa;</xsl:text>
377
+ </xsl:template>
378
+
379
+ <xsl:template match="ul/li">
380
+ <xsl:text>* </xsl:text>
381
+ <xsl:apply-templates/>
382
+ <xsl:text>&#xa;</xsl:text>
383
+ </xsl:template>
384
+
385
+ <xsl:template match="dl/li">
386
+ <xsl:apply-templates select="." mode="title-full"/>
387
+ <xsl:text> </xsl:text>
388
+ <xsl:apply-templates/>
389
+ <xsl:text>&#xa;</xsl:text>
390
+ </xsl:template>
391
+
392
+ </xsl:stylesheet>
@@ -0,0 +1,195 @@
1
+ <?xml version="1.0" encoding="UTF-8" ?>
2
+
3
+ <xsl:stylesheet version="1.0"
4
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
5
+
6
+ <!--********************************************************************
7
+ Copyright 2013 Robert A. Beezer
8
+
9
+ This file is part of MathBook XML.
10
+
11
+ MathBook XML is free software: you can redistribute it and/or modify
12
+ it under the terms of the GNU General Public License as published by
13
+ the Free Software Foundation, either version 2 or version 3 of the
14
+ License (at your option).
15
+
16
+ MathBook XML is distributed in the hope that it will be useful,
17
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
+ GNU General Public License for more details.
20
+
21
+ You should have received a copy of the GNU General Public License
22
+ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
23
+ *********************************************************************-->
24
+
25
+ <!-- This file contains unit-related abbreviations, such as 'kilo' => 'k' -->
26
+ <!-- and 'meter' => 'm'. These are used by the quantity/unit and quantity/per -->
27
+ <!-- elements for HMTL output, and possibly other places in the future. -->
28
+ <!-- For tex, the siunitx package knows \kilo, \meter, etc. If there is a unit -->
29
+ <!-- that siunitx does not know, the abbreviations here are used to add it to -->
30
+ <!-- the preamble. -->
31
+ <!-- Future enhancements (which maybe happen in other stylesheets, not here): -->
32
+ <!-- 1. If MathJax siunitx extension is functional, start using it for HTML. -->
33
+ <!-- 2. Make use of siunitx's \of{}. -->
34
+ <!-- 3. Create a docinfo element that adds custom units. -->
35
+
36
+ <!-- Unit prefixes (the prefix attribute in a unit or per tag) -->
37
+ <!-- SI prefixes -->
38
+ <xsl:variable name="prefixes">
39
+ <prefix full='yocto' short='y'/>
40
+ <prefix full='zepto' short='z'/>
41
+ <prefix full='atto' short='a'/>
42
+ <prefix full='femto' short='f'/>
43
+ <prefix full='pico' short='p'/>
44
+ <prefix full='nano' short='n'/>
45
+ <prefix full='micro' short='&#xb5;'/>
46
+ <prefix full='milli' short='m'/>
47
+ <prefix full='centi' short='c'/>
48
+ <prefix full='deci' short='d'/>
49
+ <prefix full='deca' short='da'/>
50
+ <prefix full='deka' short='da'/>
51
+ <prefix full='hecto' short='h'/>
52
+ <prefix full='kilo' short='k'/>
53
+ <prefix full='mega' short='M'/>
54
+ <prefix full='giga' short='G'/>
55
+ <prefix full='tera' short='T'/>
56
+ <prefix full='peta' short='P'/>
57
+ <prefix full='exa' short='E'/>
58
+ <prefix full='zetta' short='Z'/>
59
+ <prefix full='yotta' short='Y'/>
60
+ </xsl:variable>
61
+
62
+
63
+ <!-- Unit bases (the base attribute in a unit or per tag) -->
64
+ <xsl:variable name="bases">
65
+ <!-- SI fundamental units -->
66
+ <base full='ampere' short='A'/>
67
+ <base full='candela' short='cd'/>
68
+ <base full='kelvin' short='K'/>
69
+ <base full='gram' short='g'/>
70
+ <base full='meter' short='m'/>
71
+ <base full='metre' short='m'/>
72
+ <base full='mole' short='mol'/>
73
+ <base full='second' short='s'/>
74
+
75
+ <!-- SI derived units and non-SI units with a simple relationship to SI units -->
76
+ <!-- Radioactivity -->
77
+ <base full='becquerel' short='Bq'/>
78
+ <base full='gray' short='Gy'/>
79
+ <base full='sievert' short='Sv'/>
80
+
81
+ <!-- Temperature -->
82
+ <base full='degreeCelsius' short='&#176;C'/>
83
+ <base full='celsius' short='&#176;C'/>
84
+
85
+ <!-- Elecro-magnetic -->
86
+ <base full='coulomb' short='C'/>
87
+ <base full='henry' short='H'/>
88
+ <base full='ohm' short='&#8486;'/>
89
+ <base full='siemens' short='S'/>
90
+ <base full='tesla' short='T'/>
91
+ <base full='volt' short='V'/>
92
+ <base full='electronvolt' short='eV'/>
93
+ <base full='weber' short='Wb'/>
94
+
95
+ <!-- Frequency and Catalytic Activity -->
96
+ <base full='hertz' short='Hz'/>
97
+ <base full='katal' short='kat'/>
98
+
99
+ <!-- Energy, Work, Power, Force -->
100
+ <base full='joule' short='J'/>
101
+ <base full='newton' short='N'/>
102
+ <base full='pascal' short='Pa'/>
103
+ <base full='watt' short='W'/>
104
+
105
+ <!-- Candela-related -->
106
+ <base full='lumen' short='lm'/>
107
+ <base full='lux' short='lx'/>
108
+
109
+ <!-- Angle (2D and 3D) -->
110
+ <base full='radian' short='rad'/>
111
+ <base full='steradian' short='sr'/>
112
+ <base full='degree' short='&#176;'/>
113
+ <base full='arcminute' short='&#8242;'/>
114
+ <base full='arcsecond' short='&#8243;'/>
115
+
116
+ <!-- Time -->
117
+ <base full='day' short='d'/>
118
+ <base full='hour' short='h'/>
119
+ <base full='minute' short='min'/>
120
+
121
+ <!-- Area -->
122
+ <base full='hectare' short='ha'/>
123
+
124
+ <!-- Volume -->
125
+ <base full='liter' short='L'/>
126
+ <base full='litre' short='l'/>
127
+
128
+ <!-- Mass -->
129
+ <base full='tonne' short='t'/>
130
+
131
+ <!-- Percent -->
132
+ <base full='percent' short='&#37;'/>
133
+
134
+ <!-- completely non-SI units; these are not part of the siunitx package, so they -->
135
+ <!-- need siunitx='none'. The value of 'short' will be used as the macro output, -->
136
+ <!-- unless something else is specified. This is necessary if the value of 'short' -->
137
+ <!-- has unusual characters, as with Fahrenheit below. -->
138
+ <!-- Temperature -->
139
+ <base full='degreeFahrenheit' short='&#176;F' siunitx='\SIUnitSymbolDegree{F}' />
140
+ <base full='fahrenheit' short='&#176;F' siunitx='\degreeFahrenheit' />
141
+
142
+ <!-- Weight, Force -->
143
+ <base full='pound' short='lb' siunitx='none' />
144
+ <base full='ounce' short='oz' siunitx='none' />
145
+ <base full='ton' short='T' siunitx='none' />
146
+
147
+ <!-- Length -->
148
+ <base full='foot' short='ft' siunitx='none' />
149
+ <base full='inch' short='in' siunitx='none' />
150
+ <base full='yard' short='yd' siunitx='none' />
151
+ <base full='mile' short='mi' siunitx='none' />
152
+
153
+ <!-- Time -->
154
+ <base full='millennium' short='millennium' siunitx='none' />
155
+ <base full='century' short='century' siunitx='none' />
156
+ <base full='decade' short='decade' siunitx='none' />
157
+ <base full='year' short='yr' siunitx='none' />
158
+ <base full='month' short='mo' siunitx='none' />
159
+ <base full='week' short='wk' siunitx='none' />
160
+
161
+ <!-- Speed -->
162
+ <base full='kilometerperhour' short='kph' siunitx='none' />
163
+ <base full='kilometreperhour' short='kph' siunitx='none' />
164
+ <base full='mileperhour' short='mph' siunitx='none' />
165
+
166
+ <!-- Volume -->
167
+ <base full='gallon' short='gal' siunitx='none' />
168
+ <base full='cubiccentimeter' short='cc' siunitx='none' />
169
+ <base full='tablespoon' short='tbsp' siunitx='none' />
170
+ <base full='teaspoon' short='tsp' siunitx='none' />
171
+ <base full='cup' short='c' siunitx='none' />
172
+ <base full='pint' short='pt' siunitx='none' />
173
+ <base full='quart' short='qt' siunitx='none' />
174
+ <base full='fluidounce' short='fl&#8239;oz' siunitx='none' />
175
+
176
+ <!-- Distance per Volume -->
177
+ <base full='milepergallon' short='mpg' siunitx='none' />
178
+ <base full='kilometerpergallon' short='kpg' siunitx='none' />
179
+
180
+ <!-- Frequency and Catalytic Activity -->
181
+ <base full='revolution' short='rev' siunitx='none' />
182
+ <base full='revolutionperminute' short='rpm' siunitx='none' />
183
+ <base full='cycle' short='cycle' siunitx='none' />
184
+
185
+ <!-- Storage, Memory, and Transfer Rate -->
186
+ <base full='bit' short='b' siunitx='none' />
187
+ <base full='byte' short='B' siunitx='none' />
188
+ <base full='bitpersecond' short='bps' siunitx='none' />
189
+ <base full='bytepersecond' short='Bps' siunitx='none' />
190
+
191
+ </xsl:variable>
192
+
193
+
194
+
195
+ </xsl:stylesheet>