@pretextbook/pretext-html 0.6.0 → 0.8.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 (98) hide show
  1. package/README.md +31 -2
  2. package/assets/upstream.json +1 -1
  3. package/assets/xsl/LICENSE-pretext +1 -1
  4. package/assets/xsl/README.md +19 -0
  5. package/assets/xsl/entities.ent +15 -4
  6. package/assets/xsl/extract-asymptote.xsl +5 -5
  7. package/assets/xsl/extract-biblio-csl.xsl +1 -1
  8. package/assets/xsl/extract-datafile.xsl +1 -1
  9. package/assets/xsl/extract-dynamic.xsl +1 -1
  10. package/assets/xsl/extract-identity.xsl +5 -5
  11. package/assets/xsl/extract-interactive.xsl +1 -1
  12. package/assets/xsl/extract-latex-image.xsl +5 -5
  13. package/assets/xsl/extract-mermaid.xsl +1 -1
  14. package/assets/xsl/extract-mom.xsl +5 -5
  15. package/assets/xsl/extract-pg.xsl +1 -1
  16. package/assets/xsl/extract-prefigure.xsl +5 -5
  17. package/assets/xsl/extract-qrcode.xsl +1 -1
  18. package/assets/xsl/extract-runestone-page-template.xsl +1 -1
  19. package/assets/xsl/extract-sageplot.xsl +5 -5
  20. package/assets/xsl/extract-stack.xsl +1 -1
  21. package/assets/xsl/extract-trace.xsl +1 -1
  22. package/assets/xsl/extract-youtube.xsl +5 -5
  23. package/assets/xsl/latex/pretext-latex-AIM.xsl +1 -1
  24. package/assets/xsl/latex/pretext-latex-chaos.xsl +1 -1
  25. package/assets/xsl/latex/pretext-latex-dyslexic-font.xsl +1 -1
  26. package/assets/xsl/latex/pretext-latex-guide.xsl +1 -1
  27. package/assets/xsl/localizations/README.md +1 -1
  28. package/assets/xsl/localizations/af-ZA.xml +1 -1
  29. package/assets/xsl/localizations/bg-BG.xml +1 -1
  30. package/assets/xsl/localizations/ca-ES.xml +1 -1
  31. package/assets/xsl/localizations/cs-CZ.xml +1 -1
  32. package/assets/xsl/localizations/de-DE.xml +1 -1
  33. package/assets/xsl/localizations/en-US.xml +1 -1
  34. package/assets/xsl/localizations/es-ES.xml +1 -1
  35. package/assets/xsl/localizations/fi-FI.xml +1 -1
  36. package/assets/xsl/localizations/fr-CA.xml +1 -1
  37. package/assets/xsl/localizations/fr-FR.xml +1 -1
  38. package/assets/xsl/localizations/hu-HU.xml +1 -1
  39. package/assets/xsl/localizations/it-IT.xml +1 -1
  40. package/assets/xsl/localizations/ku-CKB.xml +1 -1
  41. package/assets/xsl/localizations/localizations.xml +1 -1
  42. package/assets/xsl/localizations/nl-NL.xml +1 -1
  43. package/assets/xsl/localizations/pt-BR.xml +1 -1
  44. package/assets/xsl/localizations/pt-PT.xml +1 -1
  45. package/assets/xsl/localizations/zh-HANS.xml +1 -1
  46. package/assets/xsl/pretext-assembly.xsl +66 -7
  47. package/assets/xsl/pretext-basic-html.xsl +5 -5
  48. package/assets/xsl/pretext-braille-preprint.xsl +5 -5
  49. package/assets/xsl/pretext-common.xsl +123 -32
  50. package/assets/xsl/pretext-dynamic.xsl +1 -1
  51. package/assets/xsl/pretext-epub.xsl +94 -85
  52. package/assets/xsl/pretext-fo.xsl +18 -20
  53. package/assets/xsl/pretext-html.xsl +260 -74
  54. package/assets/xsl/pretext-json-manifest.xsl +1 -1
  55. package/assets/xsl/pretext-jupyter.xsl +5 -5
  56. package/assets/xsl/pretext-latex-classic.xsl +1 -1
  57. package/assets/xsl/pretext-latex-common.xsl +35 -22
  58. package/assets/xsl/pretext-latex.xsl +3 -3
  59. package/assets/xsl/pretext-litprog.xsl +9 -2
  60. package/assets/xsl/pretext-markdown.xsl +1 -1
  61. package/assets/xsl/pretext-numbers.xsl +1 -1
  62. package/assets/xsl/pretext-revealjs.xsl +1 -3
  63. package/assets/xsl/pretext-runestone-fitb.xsl +18 -0
  64. package/assets/xsl/pretext-runestone-static.xsl +13 -1
  65. package/assets/xsl/pretext-runestone.xsl +39 -27
  66. package/assets/xsl/pretext-sage-doctest.xsl +18 -0
  67. package/assets/xsl/pretext-solution-manual-latex.xsl +4 -4
  68. package/assets/xsl/pretext-text-utilities.xsl +1 -1
  69. package/assets/xsl/pretext-text.xsl +5 -5
  70. package/assets/xsl/pretext-units.xsl +5 -5
  71. package/assets/xsl/pretext-view-source.xsl +1 -1
  72. package/assets/xsl/pretext-ww-problem-sets.xsl +15 -12
  73. package/assets/xsl/publisher-variables.xsl +160 -133
  74. package/assets/xsl/support/README.md +19 -0
  75. package/assets/xsl/support/extract-math.xsl +1 -1
  76. package/assets/xsl/support/package-math.xsl +1 -1
  77. package/assets/xsl/support/webpack_static_imports.xml +19 -0
  78. package/assets/xsl/tests/README.md +19 -0
  79. package/assets/xsl/tests/null.xml +19 -0
  80. package/assets/xsl/tests/pretext-text-utilities-test.xsl +1 -1
  81. package/assets/xsl/utilities/README.md +19 -0
  82. package/assets/xsl/utilities/author-report.xsl +1 -1
  83. package/assets/xsl/utilities/fix-deprecations.xsl +5 -5
  84. package/assets/xsl/utilities/pretext-enhanced-source.xsl +1 -1
  85. package/assets/xsl/utilities/report-publisher-variables.xsl +5 -5
  86. package/assets/xsl/xml-to-json.xsl +4 -4
  87. package/assets/xsl-bundle.json +1 -1
  88. package/dist/banner.d.ts +51 -0
  89. package/dist/{cli-DF7XOWN7.js → cli-Bcn4t3B1.js} +387 -240
  90. package/dist/cli.js +2 -2
  91. package/dist/html-static.d.ts +20 -0
  92. package/dist/index.browser.d.ts +2 -0
  93. package/dist/index.browser.js +554 -407
  94. package/dist/index.d.ts +2 -0
  95. package/dist/index.js +28 -25
  96. package/dist/renderer.d.ts +18 -1
  97. package/package.json +2 -1
  98. package/assets/xsl/pretext-smc.xsl +0 -492
@@ -1,7 +1,7 @@
1
1
  <?xml version='1.0'?>
2
2
 
3
3
  <!--********************************************************************
4
- Copyright 2020 Robert A. Beezer
4
+ Copyright (C) 2020-2026 Robert A. Beezer
5
5
 
6
6
  This file is part of PreTeXt.
7
7
 
@@ -1156,12 +1156,41 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
1156
1156
  <!-- while a trailing slash will be reliably added if -->
1157
1157
  <!-- (a) not present in publisher file specification -->
1158
1158
  <!-- (b) the path is not empty -->
1159
+ <!-- The external directory is a property of the source (a different -->
1160
+ <!-- directory of files is a different document), so its declaration -->
1161
+ <!-- is "directories/@external" within "docinfo" (2026-07-30). The -->
1162
+ <!-- publication file "source/directories/@external" is deprecated but -->
1163
+ <!-- honored while the "docinfo" is silent. NB: the version tree is -->
1164
+ <!-- consulted, since machinery within the assembly chain consumes -->
1165
+ <!-- directory variables and the tree behind $docinfo does not exist -->
1166
+ <!-- yet at that point (referencing it is a circular definition). -->
1159
1167
  <xsl:variable name="external-directory-source">
1160
- <xsl:variable name="raw-input" select="$publication/source/directories/@external"/>
1168
+ <!-- an empty declaration is an error, not an election -->
1169
+ <xsl:if test="$version-docinfo/directories/@external = ''">
1170
+ <xsl:message terminate="yes">PTX:FATAL: the value of "directories/@external" within "docinfo" must be nonempty</xsl:message>
1171
+ </xsl:if>
1172
+ <xsl:if test="$publication/source/directories/@external = ''">
1173
+ <xsl:message terminate="yes">PTX:FATAL: the value of source/directories/@external in the publisher file must be nonempty</xsl:message>
1174
+ </xsl:if>
1175
+ <xsl:variable name="raw-input">
1176
+ <xsl:choose>
1177
+ <xsl:when test="$version-docinfo/directories/@external">
1178
+ <xsl:if test="$publication/source/directories/@external">
1179
+ <xsl:message>PTX:WARNING: the external directory is specified both within "docinfo" ("directories/@external") and in the publication file ("source/directories/@external"). The "docinfo" value is used; please remove the publication file entry.</xsl:message>
1180
+ </xsl:if>
1181
+ <xsl:value-of select="$version-docinfo/directories/@external"/>
1182
+ </xsl:when>
1183
+ <xsl:when test="$publication/source/directories/@external">
1184
+ <xsl:message>PTX:DEPRECATE: (2026-07-30) the external directory is a property of your source, and is now declared with a "directories/@external" attribute within "docinfo". The publication file entry "source/directories/@external" is honored meanwhile, but please relocate it.</xsl:message>
1185
+ <xsl:value-of select="$publication/source/directories/@external"/>
1186
+ </xsl:when>
1187
+ <xsl:otherwise/>
1188
+ </xsl:choose>
1189
+ </xsl:variable>
1161
1190
  <xsl:choose>
1162
1191
  <!-- leading path separator is an error -->
1163
1192
  <xsl:when test="substring($raw-input, 1, 1) = '/'">
1164
- <xsl:message>PTX:FALLBACK: an external-image directory (source/directories/@external in the publisher file) must be a relative path and not begin with "/" as in "<xsl:value-of select="$raw-input"/>". Proceeding with the default, which is an empty string, and may lead to unexpected results.</xsl:message>
1193
+ <xsl:message>PTX:FALLBACK: an external-image directory ("directories/@external", within "docinfo" or the publication file) must be a relative path and not begin with "/" as in "<xsl:value-of select="$raw-input"/>". Proceeding with the default, which is an empty string, and may lead to unexpected results.</xsl:message>
1165
1194
  <xsl:text/>
1166
1195
  </xsl:when>
1167
1196
  <!-- trailing path separator is good and -->
@@ -1178,113 +1207,68 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
1178
1207
  </xsl:choose>
1179
1208
  </xsl:variable>
1180
1209
 
1181
- <!-- Historically this was given by the "images" directory as a default, -->
1182
- <!-- and it seems almost every author just ran with this. -->
1210
+ <!-- The generated directory is machine-owned, so it is defaultable: -->
1211
+ <!-- an undeclared location is the directory "generated", beside the -->
1212
+ <!-- source. (Historically an unmanaged scheme fell back to the -->
1213
+ <!-- "images" directory; managed directories are now the only scheme.)-->
1183
1214
  <xsl:variable name="generated-directory-source">
1184
- <xsl:variable name="raw-input" select="$publication/source/directories/@generated"/>
1185
- <xsl:choose>
1186
- <xsl:when test="$b-managed-directories">
1187
- <xsl:choose>
1188
- <xsl:when test="substring($raw-input, 1, 1) = '/'">
1189
- <xsl:message>PTX:FALLBACK: a generated-image directory (source/directories/@generated in the publisher file) must be a relative path and not begin with "/" as in "<xsl:value-of select="$raw-input"/>". Proceeding with the default, which is an empty string, and may lead to unexpected results.</xsl:message>
1190
- <xsl:text/>
1191
- </xsl:when>
1192
- <!-- trailing path separator is good -->
1193
- <xsl:when test="substring($raw-input, string-length($raw-input), 1) = '/'">
1194
- <xsl:value-of select="$raw-input"/>
1195
- </xsl:when>
1196
- <!-- if there is substance, we need to add a trailing slash -->
1197
- <xsl:when test="string-length($raw-input) > 0">
1198
- <xsl:value-of select="concat($raw-input, '/')"/>
1199
- </xsl:when>
1200
- <!-- specification must be empty, so we leave it that way -->
1201
- <xsl:otherwise/>
1202
- </xsl:choose>
1203
- </xsl:when>
1204
- <!-- Should issue a deprecation warning (elsewhere) for this. -->
1205
- <!-- directory.images *is* defined elsewhere in this stylesheet, -->
1206
- <!-- and defaults to "images", but does not have a slash, which -->
1207
- <!-- is presumed for the $generated-directory variable -->
1208
- <xsl:otherwise>
1209
- <xsl:value-of select="concat($directory.images, '/')"/>
1210
- </xsl:otherwise>
1211
- </xsl:choose>
1212
- </xsl:variable>
1213
-
1214
- <!-- For backward-compatibility, we want to know if the collection of -->
1215
- <!-- generated images is structured by their production method (newer) -->
1216
- <!-- or not (older, historical). So we create a boolean based on the -->
1217
- <!-- presence of the publisher file specification. -->
1218
- <xsl:variable name="managed-directories">
1219
- <xsl:if test="$publication/source/directories/@external = ''">
1220
- <xsl:message terminate="yes">PTX:FATAL: the value of source/directories/@external in the publisher file must be nonempty</xsl:message>
1221
- </xsl:if>
1222
1215
  <xsl:if test="$publication/source/directories/@generated = ''">
1223
1216
  <xsl:message terminate="yes">PTX:FATAL: the value of source/directories/@generated in the publisher file must be nonempty</xsl:message>
1224
1217
  </xsl:if>
1218
+ <xsl:variable name="raw-input">
1219
+ <xsl:choose>
1220
+ <xsl:when test="$publication/source/directories/@generated">
1221
+ <xsl:value-of select="$publication/source/directories/@generated"/>
1222
+ </xsl:when>
1223
+ <xsl:otherwise>
1224
+ <xsl:text>generated</xsl:text>
1225
+ </xsl:otherwise>
1226
+ </xsl:choose>
1227
+ </xsl:variable>
1225
1228
  <xsl:choose>
1226
- <xsl:when test="$publication/source/directories/@external and $publication/source/directories/@generated">
1227
- <xsl:text>yes</xsl:text>
1229
+ <xsl:when test="substring($raw-input, 1, 1) = '/'">
1230
+ <xsl:message>PTX:FALLBACK: a generated-image directory (source/directories/@generated in the publisher file) must be a relative path and not begin with "/" as in "<xsl:value-of select="$raw-input"/>". Proceeding with the default, which is an empty string, and may lead to unexpected results.</xsl:message>
1231
+ <xsl:text/>
1228
1232
  </xsl:when>
1229
- <xsl:when test="not($publication/source/directories/@external) and not($publication/source/directories/@generated)">
1230
- <xsl:text>no</xsl:text>
1233
+ <!-- trailing path separator is good -->
1234
+ <xsl:when test="substring($raw-input, string-length($raw-input), 1) = '/'">
1235
+ <xsl:value-of select="$raw-input"/>
1231
1236
  </xsl:when>
1237
+ <!-- add the trailing slash -->
1232
1238
  <xsl:otherwise>
1233
- <xsl:message>PTX:FALLBACK: the publisher file specifies one of source/directories/@external and source/directories/@generated, but not both. Proceeding as if neither was specified.</xsl:message>
1234
- <xsl:text>no</xsl:text>
1239
+ <xsl:value-of select="concat($raw-input, '/')"/>
1235
1240
  </xsl:otherwise>
1236
1241
  </xsl:choose>
1237
1242
  </xsl:variable>
1238
- <xsl:variable name="b-managed-directories" select="$managed-directories = 'yes'"/>
1239
1243
 
1240
- <!-- Destination directory is hard-coded here and used in -->
1241
- <!-- various conversions under the managed directories scheme. -->
1242
- <xsl:variable name="external-directory">
1243
- <xsl:choose>
1244
- <xsl:when test="$b-managed-directories">
1245
- <xsl:text>external/</xsl:text>
1246
- </xsl:when>
1247
- <!-- backwards-compatiblity, there never was any sort of -->
1248
- <!-- naming/copying scheme for externally produced content -->
1249
- <xsl:otherwise/>
1250
- </xsl:choose>
1251
- </xsl:variable>
1244
+ <!-- Managed directories are the only scheme (2026-08-02). The two -->
1245
+ <!-- directions are independent facts: an undeclared external means -->
1246
+ <!-- the project has no external assets, and the machine-owned -->
1247
+ <!-- generated directory is defaultable. -->
1252
1248
 
1253
- <!-- There was once a scheme of sorts for managing the directory -->
1254
- <!-- where generated images landed and were found. So we need -->
1255
- <!-- to preserve that logic for backward-compatibility. -->
1256
- <xsl:variable name="generated-directory">
1257
- <xsl:choose>
1258
- <xsl:when test="$b-managed-directories">
1259
- <xsl:value-of select="'generated/'"/>
1260
- </xsl:when>
1261
- <!-- Should issue a deprecation warning (elsewhere) for this. -->
1262
- <!-- directory.images *is* defined elsewhere in this stylesheet, -->
1263
- <!-- and defaults to "images", but does not have a slash, which -->
1264
- <!-- is presumed for the $generated-directory variable -->
1265
- <xsl:otherwise>
1266
- <xsl:value-of select="concat($directory.images, '/')"/>
1267
- </xsl:otherwise>
1268
- </xsl:choose>
1269
- </xsl:variable>
1249
+
1250
+ <!-- The destination directories within any output are hard-coded -->
1251
+ <!-- here, and used in the various conversions. -->
1252
+ <xsl:variable name="external-directory" select="'external/'"/>
1253
+ <xsl:variable name="generated-directory" select="'generated/'"/>
1270
1254
 
1271
1255
 
1272
1256
  <!-- This is a directory that may need to be copied to a -->
1273
1257
  <!-- scratch location in anticipation of data files necessary -->
1274
1258
  <!-- for compilation of images, such as pie charts or plots -->
1275
- <!-- NB: this is broken and waiting for generated and external to settle down -->
1259
+ <!-- The data directory runs with the source, declared as -->
1260
+ <!-- "directories/@data" within "docinfo" (the version tree, -->
1261
+ <!-- for the same reason as the external directory above). -->
1262
+ <!-- An earlier form of this variable consulted a publication -->
1263
+ <!-- file "source/directories/@data" which was never in the -->
1264
+ <!-- publication schema, and hard-coded the value "data". -->
1276
1265
  <xsl:variable name="data-directory">
1277
1266
  <xsl:variable name="raw-input">
1278
- <xsl:choose>
1279
- <xsl:when test="$publication/source/directories/@data">
1280
- <xsl:value-of select="'data'"/>
1281
- </xsl:when>
1282
- <xsl:otherwise/>
1283
- </xsl:choose>
1267
+ <xsl:value-of select="$version-docinfo/directories/@data"/>
1284
1268
  </xsl:variable>
1285
1269
  <xsl:choose>
1286
1270
  <xsl:when test="substring($raw-input, 1, 1) = '/'">
1287
- <xsl:message>PTX:FALLBACK: a data directory (source/directories/@data in the publisher file) must be a relative path and not begin with "/" as in "<xsl:value-of select="$raw-input"/>". Proceeding with the default, which is an empty string, and may lead to unexpected results.</xsl:message>
1271
+ <xsl:message>PTX:FALLBACK: a data directory ("directories/@data" within "docinfo") must be a relative path and not begin with "/" as in "<xsl:value-of select="$raw-input"/>". Proceeding with the default, which is an empty string, and may lead to unexpected results.</xsl:message>
1288
1272
  <xsl:text/>
1289
1273
  </xsl:when>
1290
1274
  <!-- trailing path separator is good -->
@@ -1405,22 +1389,17 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
1405
1389
  <!-- variable since it will not be used, and it is silent. -->
1406
1390
  <xsl:if test="$original//webwork[node() or @*]">
1407
1391
  <xsl:choose>
1408
- <!-- Note: $generated-directory-source is never empty? -->
1409
- <!-- Defaults to the very old "directory.images"? -->
1410
- <!-- So testing for the publication file entry is better. -->
1411
- <xsl:when test="$publication/source/directories/@generated">
1412
- <xsl:value-of select="str:replace(concat($generated-directory-source, 'webwork/'), '&#x20;', '%20')"/>
1413
- </xsl:when>
1414
- <xsl:when test="$publication/source/@webwork-problems">
1392
+ <!-- the deprecated location is honored only when no -->
1393
+ <!-- generated directory is declared -->
1394
+ <xsl:when test="$publication/source/@webwork-problems and not($publication/source/directories/@generated)">
1415
1395
  <xsl:value-of select="str:replace($publication/source/@webwork-problems, '&#x20;', '%20')"/>
1416
1396
  <xsl:message>PTX:DEPRECATE: the publication file entry source/@webwork-problems is</xsl:message>
1417
1397
  <xsl:message> deprecated, please move to using managed directories</xsl:message>
1418
1398
  </xsl:when>
1419
- <!-- no specification, so empty string for filename -->
1420
- <!-- this will be noted where it is employed -->
1421
- <!-- no specification, so empty string for directory -->
1422
- <!-- this will be noted where it is employed -->
1423
- <xsl:otherwise/>
1399
+ <!-- the generated directory, declared or defaulted -->
1400
+ <xsl:otherwise>
1401
+ <xsl:value-of select="str:replace(concat($generated-directory-source, 'webwork/'), '&#x20;', '%20')"/>
1402
+ </xsl:otherwise>
1424
1403
  </xsl:choose>
1425
1404
  </xsl:if>
1426
1405
  </xsl:variable>
@@ -1432,15 +1411,8 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
1432
1411
  <xsl:variable name="dynamic-substitutions-file">
1433
1412
  <!-- Only relevant if there are dynamic exercises present. -->
1434
1413
  <xsl:if test="$original//exercise//setup">
1435
- <xsl:choose>
1436
- <!-- Look in the publication file for the generated directory -->
1437
- <xsl:when test="$publication/source/directories/@generated">
1438
- <xsl:value-of select="str:replace(concat($generated-directory-source, 'dynamic_subs/dynamic_substitutions.xml'), '&#x20;', '%20')"/>
1439
- </xsl:when>
1440
- <!-- no specification, so empty string for filename -->
1441
- <!-- this will be noted where it is employed -->
1442
- <xsl:otherwise/>
1443
- </xsl:choose>
1414
+ <!-- the generated directory, declared or defaulted -->
1415
+ <xsl:value-of select="str:replace(concat($generated-directory-source, 'dynamic_subs/dynamic_substitutions.xml'), '&#x20;', '%20')"/>
1444
1416
  </xsl:if>
1445
1417
  </xsl:variable>
1446
1418
 
@@ -2709,23 +2681,19 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
2709
2681
  <!-- Always use cdn when "b-portable-html" is true or "resources-host" is "cdn" -->
2710
2682
  <xsl:variable name="b-cdn-resources" select="$b-portable-html or $resources-host = 'cdn'"/>
2711
2683
 
2712
- <!-- HTML chunk-level defaults, available to any stylesheet that -->
2713
- <!-- needs to compute HTML filenames via the "containing-filename" -->
2714
- <!-- template (pretext-common.xsl) without importing the full -->
2715
- <!-- pretext-html.xsl. Uses $version-root rather than $root -->
2716
- <!-- because this is computed before later assembly passes. The -->
2717
- <!-- contract (documented at the definition of $version-root in -->
2718
- <!-- pretext-assembly.xsl) is that no assembly pass alters the -->
2719
- <!-- gross document structure (book/article type, part/chapter/ -->
2720
- <!-- section hierarchy), so $version-root is reliable for these -->
2721
- <!-- top-level queries. Same contract relied upon by $toc-level. -->
2722
- <xsl:variable name="html-chunk-level">
2684
+ <!-- The chunk level a document's structure implies, with no publisher -->
2685
+ <!-- or command-line choice consulted. A conversion that accepts such -->
2686
+ <!-- a choice layers it over this; one that does not, such as EPUB, -->
2687
+ <!-- uses this as-is, so the two can never drift apart. -->
2688
+ <!-- Uses $version-root rather than $root because this is computed -->
2689
+ <!-- before later assembly passes. The contract (documented at the -->
2690
+ <!-- definition of $version-root in pretext-assembly.xsl) is that no -->
2691
+ <!-- assembly pass alters the gross document structure (book/article -->
2692
+ <!-- type, part/chapter/section hierarchy), so $version-root is -->
2693
+ <!-- reliable for these top-level queries. Same contract relied upon -->
2694
+ <!-- by $toc-level. -->
2695
+ <xsl:variable name="chunk-level-default">
2723
2696
  <xsl:choose>
2724
- <!-- portable html always gets chunk level 0 -->
2725
- <xsl:when test="$b-portable-html">0</xsl:when>
2726
- <xsl:when test="$chunk-level-entered != ''">
2727
- <xsl:value-of select="$chunk-level-entered" />
2728
- </xsl:when>
2729
2697
  <xsl:when test="$version-has-parts">3</xsl:when>
2730
2698
  <xsl:when test="$version-doc-type = 'book'">2</xsl:when>
2731
2699
  <xsl:when test="$version-article-sections or $version-article-printouts">1</xsl:when>
@@ -2734,7 +2702,23 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
2734
2702
  <xsl:when test="$version-doc-type = 'letter'">0</xsl:when>
2735
2703
  <xsl:when test="$version-doc-type = 'memo'">0</xsl:when>
2736
2704
  <xsl:otherwise>
2737
- <xsl:message>PTX:BUG: HTML chunk level not determined</xsl:message>
2705
+ <xsl:message>PTX:BUG: chunk level not determined</xsl:message>
2706
+ </xsl:otherwise>
2707
+ </xsl:choose>
2708
+ </xsl:variable>
2709
+
2710
+ <!-- The chunk level for HTML, available to any stylesheet that needs -->
2711
+ <!-- to compute HTML filenames via the "containing-filename" template -->
2712
+ <!-- (pretext-common.xsl) without importing the full pretext-html.xsl. -->
2713
+ <xsl:variable name="html-chunk-level">
2714
+ <xsl:choose>
2715
+ <!-- portable html always gets chunk level 0 -->
2716
+ <xsl:when test="$b-portable-html">0</xsl:when>
2717
+ <xsl:when test="$chunk-level-entered != ''">
2718
+ <xsl:value-of select="$chunk-level-entered" />
2719
+ </xsl:when>
2720
+ <xsl:otherwise>
2721
+ <xsl:value-of select="$chunk-level-default"/>
2738
2722
  </xsl:otherwise>
2739
2723
  </xsl:choose>
2740
2724
  </xsl:variable>
@@ -2747,6 +2731,31 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
2747
2731
  <xsl:apply-templates select="$publisher-attribute-options/html/pi:pub-attribute[@name='favicon']" mode="set-pubfile-variable"/>
2748
2732
  </xsl:variable>
2749
2733
 
2734
+ <!-- -->
2735
+ <!-- HTML Image Archive Links -->
2736
+ <!-- -->
2737
+
2738
+ <!-- Requests for archive (download) versions of images: repeatable -->
2739
+ <!-- "archive" elements within an "images" element. The publication -->
2740
+ <!-- file form is preferred, and wins wholesale when present; the -->
2741
+ <!-- "images" element within "docinfo" is deprecated (2026-07-30) -->
2742
+ <!-- but honored while the publication file is silent. -->
2743
+ <xsl:variable name="image-archives" select="$publication/html/images/archive | $docinfo/images/archive[not($publication/html/images/archive)]"/>
2744
+
2745
+ <!-- -->
2746
+ <!-- HTML Brand Logo -->
2747
+ <!-- -->
2748
+
2749
+ <!-- An image for the masthead, optionally linking to a landing -->
2750
+ <!-- page. The publication file form is preferred, and elects -->
2751
+ <!-- the logo wholesale (both attributes); the "brandlogo" within -->
2752
+ <!-- "docinfo" is deprecated (2026-07-30) but honored while the -->
2753
+ <!-- publication file is silent. -->
2754
+ <xsl:variable name="brandlogo-elected" select="$publication/html/brandlogo | $docinfo/brandlogo[not($publication/html/brandlogo)]"/>
2755
+ <xsl:variable name="brandlogo-source" select="string($brandlogo-elected/@source)"/>
2756
+ <xsl:variable name="brandlogo-url" select="string($brandlogo-elected/@url)"/>
2757
+ <xsl:variable name="b-brandlogo" select="not($brandlogo-source = '')"/>
2758
+
2750
2759
  <!-- -->
2751
2760
  <!-- HTML Embed Page button -->
2752
2761
  <!-- -->
@@ -2756,6 +2765,14 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
2756
2765
  </xsl:variable>
2757
2766
  <xsl:variable name="b-has-embed-button" select="$embed-button = 'yes'"/>
2758
2767
 
2768
+ <!-- -->
2769
+ <!-- HTML Read-aloud control -->
2770
+ <!-- -->
2771
+
2772
+ <xsl:variable name="read-aloud">
2773
+ <xsl:apply-templates select="$publisher-attribute-options/html/pi:pub-attribute[@name='read-aloud']" mode="set-pubfile-variable"/>
2774
+ </xsl:variable>
2775
+ <xsl:variable name="b-read-aloud" select="not($read-aloud = 'no')"/>
2759
2776
 
2760
2777
  <!-- -->
2761
2778
  <!-- HTML Banner options -->
@@ -3480,6 +3497,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
3480
3497
  </common>
3481
3498
  <html>
3482
3499
  <pi:pub-attribute name="short-answer-responses" default="graded" options="always"/>
3500
+ <pi:pub-attribute name="read-aloud" default="yes" options="no"/>
3483
3501
  <pi:pub-attribute name="favicon" default="none" options="simple"/>
3484
3502
  <pi:pub-attribute name="embed-button" default="no" options="yes"/>
3485
3503
  <pi:pub-attribute name="design-width" freeform="yes"/>
@@ -3851,7 +3869,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
3851
3869
  <xsl:param name="author-tools" select="''" />
3852
3870
 
3853
3871
  <!-- The autoname parameter is deprecated (2017-07-25) -->
3854
- <!-- Replace with docinfo/cross-references/@text -->
3872
+ <!-- Replace with docinfo/defaults/xrefs/@text -->
3855
3873
  <xsl:param name="autoname" select="''" />
3856
3874
 
3857
3875
  <!-- 2020-11-22: latex.print to publisher file -->
@@ -3878,9 +3896,11 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
3878
3896
  <!-- silently moved here, which should make no real difference -->
3879
3897
  <xsl:param name="directory.knowls" select="''" />
3880
3898
 
3881
- <!-- Deprecated 2020-11-23 in favor of publisher file -->
3882
- <!-- specification, but will still be respected -->
3883
- <xsl:param name="directory.images" select="'images'" />
3899
+ <!-- Deprecated 2020-11-23 in favor of publisher file -->
3900
+ <!-- specification; as of 2026-08-02 managed -->
3901
+ <!-- directories are the only scheme, so this is dead: -->
3902
+ <!-- it survives only to power a deprecation warning. -->
3903
+ <xsl:param name="directory.images" select="''" />
3884
3904
 
3885
3905
  <!-- 2021-01-03 chunk.level to publisher file -->
3886
3906
  <xsl:param name="chunk.level" select="''" />
@@ -4065,15 +4085,15 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
4065
4085
  <!-- 2017-07-25 deprecate intentional autoname without new setting -->
4066
4086
  <xsl:call-template name="parameter-deprecation-message">
4067
4087
  <xsl:with-param name="date-string" select="'2017-07-25'" />
4068
- <xsl:with-param name="message" select="'the autoname parameter is deprecated, but is still effective since &quot;docinfo/cross-references/@text&quot; has not been set. The following parameter values equate to the attribute values: &quot;no&quot; is &quot;global&quot;, &quot;yes&quot; is &quot;type-global&quot;, &quot;title&quot; is &quot;title&quot;'" />
4069
- <xsl:with-param name="incorrect-use" select="not($autoname = '') and not(//docinfo/cross-references)" />
4088
+ <xsl:with-param name="message" select="'the autoname parameter is deprecated, but is still effective since &quot;docinfo/defaults/xrefs/@text&quot; has not been set. The following parameter values equate to the attribute values: &quot;no&quot; is &quot;global&quot;, &quot;yes&quot; is &quot;type-global&quot;, &quot;title&quot; is &quot;title&quot;'" />
4089
+ <xsl:with-param name="incorrect-use" select="not($autoname = '') and not(//docinfo/cross-references | //docinfo/defaults/xrefs)" />
4070
4090
  </xsl:call-template>
4071
4091
  <!-- -->
4072
4092
  <!-- 2017-07-25 deprecate intentional autoname also with new setting -->
4073
4093
  <xsl:call-template name="parameter-deprecation-message">
4074
4094
  <xsl:with-param name="date-string" select="'2017-07-25'" />
4075
- <xsl:with-param name="message" select="'the autoname parameter is deprecated, and is being overidden by a &quot;docinfo/cross-references/@text&quot; and so is totally ineffective and can be removed'" />
4076
- <xsl:with-param name="incorrect-use" select="not($autoname = '') and //docinfo/cross-references" />
4095
+ <xsl:with-param name="message" select="'the autoname parameter is deprecated, and is being overidden by a &quot;docinfo/defaults/xrefs/@text&quot; and so is totally ineffective and can be removed'" />
4096
+ <xsl:with-param name="incorrect-use" select="not($autoname = '') and (//docinfo/cross-references | //docinfo/defaults/xrefs)" />
4077
4097
  </xsl:call-template>
4078
4098
  <!-- -->
4079
4099
  <!-- 2017-12-18 deprecate three console macro characters -->
@@ -4671,6 +4691,13 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
4671
4691
  <xsl:with-param name="incorrect-use" select="($html.annotation != '')" />
4672
4692
  </xsl:call-template>
4673
4693
  <!-- -->
4694
+ <!-- 2026-08-02 managed directories are the only scheme -->
4695
+ <xsl:call-template name="parameter-deprecation-message">
4696
+ <xsl:with-param name="date-string" select="'2026-08-02'" />
4697
+ <xsl:with-param name="message" select="'the directory.images parameter is now ignored: managed directories are the only scheme. Generated assets live in the directory given by source/directories/@generated in the publication file (default: &quot;generated&quot;, beside the source), and external assets in the directory given by &quot;directories/@external&quot; within &quot;docinfo&quot;.'" />
4698
+ <xsl:with-param name="incorrect-use" select="($directory.images != '')" />
4699
+ </xsl:call-template>
4700
+ <!-- -->
4674
4701
  </xsl:template>
4675
4702
 
4676
4703
  </xsl:stylesheet>
@@ -1,3 +1,22 @@
1
+ <!--********************************************************************
2
+ Copyright (C) 2022-2026 Robert A. Beezer
3
+
4
+ This file is part of PreTeXt.
5
+
6
+ PreTeXt is free software: you can redistribute it and/or modify
7
+ it under the terms of the GNU General Public License as published by
8
+ the Free Software Foundation, either version 2 or version 3 of the
9
+ License (at your option).
10
+
11
+ PreTeXt is distributed in the hope that it will be useful,
12
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ GNU General Public License for more details.
15
+
16
+ You should have received a copy of the GNU General Public License
17
+ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
18
+ *****************************************************************-->
19
+
1
20
  # PreTeXt (Miscellaneous) Support Files
2
21
 
3
22
  ### Runestone Services
@@ -1,7 +1,7 @@
1
1
  <?xml version='1.0'?>
2
2
 
3
3
  <!--********************************************************************
4
- Copyright 2020 Robert A. Beezer
4
+ Copyright (C) 2020-2026 Robert A. Beezer
5
5
 
6
6
  This file is part of PreTeXt.
7
7
 
@@ -1,7 +1,7 @@
1
1
  <?xml version='1.0'?>
2
2
 
3
3
  <!--********************************************************************
4
- Copyright 2020 Robert A. Beezer
4
+ Copyright (C) 2020-2026 Robert A. Beezer
5
5
 
6
6
  This file is part of PreTeXt.
7
7
 
@@ -1,4 +1,23 @@
1
1
  <?xml version="1.0" ?>
2
+
3
+ <!--********************************************************************
4
+ Copyright (C) 2021-2026 Robert A. Beezer
5
+
6
+ This file is part of PreTeXt.
7
+
8
+ PreTeXt 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
+ PreTeXt 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 PreTeXt. If not, see <http://www.gnu.org/licenses/>.
20
+ *****************************************************************-->
2
21
  <all>
3
22
  <js type="list">
4
23
  <item type="str">prefix-runtime.00db6230172ad960.bundle.js</item>
@@ -1,3 +1,22 @@
1
+ <!--********************************************************************
2
+ Copyright (C) 2025-2026 Robert A. Beezer
3
+
4
+ This file is part of PreTeXt.
5
+
6
+ PreTeXt is free software: you can redistribute it and/or modify
7
+ it under the terms of the GNU General Public License as published by
8
+ the Free Software Foundation, either version 2 or version 3 of the
9
+ License (at your option).
10
+
11
+ PreTeXt is distributed in the hope that it will be useful,
12
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ GNU General Public License for more details.
15
+
16
+ You should have received a copy of the GNU General Public License
17
+ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
18
+ *****************************************************************-->
19
+
1
20
  # XSL Automated Tests
2
21
 
3
22
  This folder contains testing utilities for XSL templates. The tests focus on function-like templates for tasks like string manipulation that are used as helpers throughout the XSL stylesheets. Most of these functions are otherwise only observable indirectly through their effects on the output of the main XSL stylesheets.
@@ -1,4 +1,23 @@
1
1
  <?xml version="1.0" encoding="UTF-8" ?>
2
+
3
+ <!--********************************************************************
4
+ Copyright (C) 2025-2026 Robert A. Beezer
5
+
6
+ This file is part of PreTeXt.
7
+
8
+ PreTeXt 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
+ PreTeXt 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 PreTeXt. If not, see <http://www.gnu.org/licenses/>.
20
+ *****************************************************************-->
2
21
  <!-- intentionally empty valid XML file for use with pretext-text-utilities-text.xsl -->
3
22
  <nothing>
4
23
  </nothing>
@@ -1,7 +1,7 @@
1
1
  <?xml version='1.0'?>
2
2
 
3
3
  <!--********************************************************************
4
- Copyright 2022 Robert A. Beezer
4
+ Copyright (C) 2022-2026 Robert A. Beezer
5
5
 
6
6
  This file is part of PreTeXt.
7
7
 
@@ -1,3 +1,22 @@
1
+ <!--********************************************************************
2
+ Copyright (C) 2017-2026 Robert A. Beezer
3
+
4
+ This file is part of PreTeXt.
5
+
6
+ PreTeXt is free software: you can redistribute it and/or modify
7
+ it under the terms of the GNU General Public License as published by
8
+ the Free Software Foundation, either version 2 or version 3 of the
9
+ License (at your option).
10
+
11
+ PreTeXt is distributed in the hope that it will be useful,
12
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ GNU General Public License for more details.
15
+
16
+ You should have received a copy of the GNU General Public License
17
+ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
18
+ *****************************************************************-->
19
+
1
20
  # Utilities
2
21
 
3
22
  ## Source-to-Source conversions
@@ -1,7 +1,7 @@
1
1
  <?xml version='1.0'?> <!-- As XML file -->
2
2
 
3
3
  <!--********************************************************************
4
- Copyright 2018 Robert A. Beezer
4
+ Copyright (C) 2018-2026 Robert A. Beezer
5
5
 
6
6
  This file is part of PreTeXt.
7
7
 
@@ -1,22 +1,22 @@
1
1
  <?xml version='1.0'?>
2
2
 
3
3
  <!--********************************************************************
4
- Copyright 2017 Robert A. Beezer
4
+ Copyright (C) 2017-2026 Robert A. Beezer
5
5
 
6
- This file is part of MathBook XML.
6
+ This file is part of PreTeXt.
7
7
 
8
- MathBook XML is free software: you can redistribute it and/or modify
8
+ PreTeXt is free software: you can redistribute it and/or modify
9
9
  it under the terms of the GNU General Public License as published by
10
10
  the Free Software Foundation, either version 2 or version 3 of the
11
11
  License (at your option).
12
12
 
13
- MathBook XML is distributed in the hope that it will be useful,
13
+ PreTeXt is distributed in the hope that it will be useful,
14
14
  but WITHOUT ANY WARRANTY; without even the implied warranty of
15
15
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
16
  GNU General Public License for more details.
17
17
 
18
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/>.
19
+ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
20
20
  *********************************************************************-->
21
21
 
22
22
  <!-- Identify as a stylesheet -->
@@ -1,7 +1,7 @@
1
1
  <?xml version='1.0'?>
2
2
 
3
3
  <!--********************************************************************
4
- Copyright 2020 Robert A. Beezer
4
+ Copyright (C) 2020-2026 Robert A. Beezer
5
5
 
6
6
  This file is part of PreTeXt.
7
7