@pretextbook/pretext-html 0.5.0 → 0.7.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 (99) hide show
  1. package/README.md +6 -0
  2. package/assets/preview-html.xsl +14 -0
  3. package/assets/upstream.json +1 -1
  4. package/assets/xsl/LICENSE-pretext +1 -1
  5. package/assets/xsl/README.md +43 -25
  6. package/assets/xsl/entities.ent +4 -4
  7. package/assets/xsl/extract-asymptote.xsl +5 -5
  8. package/assets/xsl/extract-biblio-csl.xsl +1 -1
  9. package/assets/xsl/extract-datafile.xsl +1 -1
  10. package/assets/xsl/extract-dynamic.xsl +1 -1
  11. package/assets/xsl/extract-identity.xsl +5 -5
  12. package/assets/xsl/extract-interactive.xsl +1 -1
  13. package/assets/xsl/extract-latex-image.xsl +5 -5
  14. package/assets/xsl/extract-mermaid.xsl +1 -1
  15. package/assets/xsl/extract-mom.xsl +5 -5
  16. package/assets/xsl/extract-pg.xsl +1 -1
  17. package/assets/xsl/extract-prefigure.xsl +5 -5
  18. package/assets/xsl/extract-qrcode.xsl +1 -1
  19. package/assets/xsl/extract-runestone-page-template.xsl +1 -1
  20. package/assets/xsl/extract-sageplot.xsl +5 -5
  21. package/assets/xsl/extract-stack.xsl +1 -1
  22. package/assets/xsl/extract-trace.xsl +1 -1
  23. package/assets/xsl/extract-youtube.xsl +5 -5
  24. package/assets/xsl/latex/pretext-latex-AIM.xsl +1 -1
  25. package/assets/xsl/latex/pretext-latex-chaos.xsl +1 -1
  26. package/assets/xsl/latex/pretext-latex-dyslexic-font.xsl +1 -1
  27. package/assets/xsl/latex/pretext-latex-guide.xsl +1 -1
  28. package/assets/xsl/localizations/README.md +25 -25
  29. package/assets/xsl/localizations/af-ZA.xml +1 -1
  30. package/assets/xsl/localizations/bg-BG.xml +1 -1
  31. package/assets/xsl/localizations/ca-ES.xml +1 -1
  32. package/assets/xsl/localizations/cs-CZ.xml +1 -1
  33. package/assets/xsl/localizations/de-DE.xml +1 -1
  34. package/assets/xsl/localizations/en-US.xml +1 -1
  35. package/assets/xsl/localizations/es-ES.xml +1 -1
  36. package/assets/xsl/localizations/fi-FI.xml +1 -1
  37. package/assets/xsl/localizations/fr-CA.xml +1 -1
  38. package/assets/xsl/localizations/fr-FR.xml +1 -1
  39. package/assets/xsl/localizations/hu-HU.xml +1 -1
  40. package/assets/xsl/localizations/it-IT.xml +1 -1
  41. package/assets/xsl/localizations/ku-CKB.xml +1 -1
  42. package/assets/xsl/localizations/localizations.xml +1 -1
  43. package/assets/xsl/localizations/nl-NL.xml +1 -1
  44. package/assets/xsl/localizations/pt-BR.xml +1 -1
  45. package/assets/xsl/localizations/pt-PT.xml +1 -1
  46. package/assets/xsl/localizations/zh-HANS.xml +1 -1
  47. package/assets/xsl/pretext-assembly.xsl +64 -1
  48. package/assets/xsl/pretext-basic-html.xsl +5 -5
  49. package/assets/xsl/pretext-braille-preprint.xsl +5 -5
  50. package/assets/xsl/pretext-common.xsl +104 -30
  51. package/assets/xsl/pretext-dynamic.xsl +1 -1
  52. package/assets/xsl/pretext-epub.xsl +90 -84
  53. package/assets/xsl/pretext-fo.xsl +1 -1
  54. package/assets/xsl/pretext-html.xsl +57 -34
  55. package/assets/xsl/pretext-json-manifest.xsl +1 -1
  56. package/assets/xsl/pretext-jupyter.xsl +5 -5
  57. package/assets/xsl/pretext-latex-classic.xsl +1 -1
  58. package/assets/xsl/pretext-latex-common.xsl +7 -5
  59. package/assets/xsl/pretext-latex.xsl +3 -3
  60. package/assets/xsl/pretext-litprog.xsl +9 -2
  61. package/assets/xsl/pretext-markdown.xsl +1 -1
  62. package/assets/xsl/pretext-numbers.xsl +1 -1
  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 +34 -6
  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 +104 -36
  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/play-button/README.md +3 -1
  78. package/assets/xsl/support/webpack_static_imports.xml +19 -0
  79. package/assets/xsl/tests/README.md +20 -1
  80. package/assets/xsl/tests/null.xml +19 -0
  81. package/assets/xsl/tests/pretext-text-utilities-test.xsl +1 -1
  82. package/assets/xsl/utilities/README.md +27 -6
  83. package/assets/xsl/utilities/author-report.xsl +1 -1
  84. package/assets/xsl/utilities/fix-deprecations.xsl +5 -5
  85. package/assets/xsl/utilities/pretext-enhanced-source.xsl +1 -1
  86. package/assets/xsl/utilities/report-publisher-variables.xsl +5 -5
  87. package/assets/xsl/xml-to-json.xsl +4 -4
  88. package/assets/xsl-bundle.json +1 -1
  89. package/dist/banner.d.ts +51 -0
  90. package/dist/{cli-DZsyZERX.js → cli-D0m0Ha1j.js} +358 -196
  91. package/dist/cli.js +2 -2
  92. package/dist/index.browser.d.ts +3 -0
  93. package/dist/index.browser.js +477 -322
  94. package/dist/index.d.ts +3 -0
  95. package/dist/index.js +25 -21
  96. package/dist/knowls.d.ts +43 -0
  97. package/dist/renderer.d.ts +26 -0
  98. package/package.json +1 -1
  99. package/assets/xsl/pretext-smc.xsl +0 -492
@@ -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.
@@ -21,4 +40,4 @@ Refer to the existing tests in `pretext-text-utilities-test.xsl` for examples of
21
40
  ## Files
22
41
 
23
42
  - `pretext-text-utilities-test.xsl`: Contains tests for the text utilities templates.
24
- - `null.xml`: A minimal XML file used as input for the tests.
43
+ - `null.xml`: A minimal XML file used as input for the tests.
@@ -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,29 +1,50 @@
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
4
23
 
5
- For utility programs here which rewrite your source, be **sure** to use version control (collect and review changes on a branch, stash and drop undesirable outcomes), or have backups handy. The effects are not reversible. Stylesheets will output to standard output, so you can redirect their output, or you can use something like the `-o` flag on the `xsltproc` command-line invocation. Experiment first.
24
+ For utility programs here which rewrite your source, be **sure** to use version control (collect and review changes on a branch, stash and drop undesirable outcomes), or have backups handy. The effects are not reversible. Stylesheets will output to standard output, so you can redirect their output, or you can use something like the `-o` flag on the `xsltproc` command-line invocation. Experiment first.
6
25
 
7
26
  ### `fix-deprecations.xsl`
8
- This will convert any obsolete element names or constructions to their replacements. As deprecations are added, you may run it anew, and only the new changes will be applied. Despite the name, it does make some minor changes. Empty tags will get a single space prior to the closing backslash.
9
27
 
10
- Be sure to read all the details in the Author's Guide before using this on your source. Here is an absolute minimal example.
28
+ This will convert any obsolete element names or constructions to their replacements. As deprecations are added, you may run it anew, and only the new changes will be applied. Despite the name, it does make some minor changes. Empty tags will get a single space prior to the closing backslash.
29
+
30
+ Be sure to read all the details in the Author's Guide before using this on your source. Here is an absolute minimal example.
31
+
11
32
  ```
12
33
  $ xsltproc /path/to/xsl/utilities/fix-deprecations.xsl -stringparam fix all /path/to/examples/sample-errors-and-warnings.xml > new-sample.xml
13
34
 
14
35
  $ diff /path/to/examples/sample-errors-and-warnings.xml new-sample.xml
15
36
  ```
16
- (Updated: 2017-07-04)
17
37
 
38
+ (Updated: 2017-07-04)
18
39
 
19
40
  ## Author Report
20
41
 
21
- `author-report.xsl` is a very simple stylesheet which will produce a text version of items in your source that could benefit from your attention. This is different than validating your PreTeXt source against the schema, but is part of using automated tools to ensure healthy source material.
42
+ `author-report.xsl` is a very simple stylesheet which will produce a text version of items in your source that could benefit from your attention. This is different than validating your PreTeXt source against the schema, but is part of using automated tools to ensure healthy source material.
22
43
 
23
44
  (Updated: 2018-12-09)
24
45
 
25
46
  ## Intermediate Enhanced Source
26
47
 
27
- `pretext-enhanced-source.xsl` is mainly meant for development use. It outputs an XML file, which is not necessarily valid PreTeXt, at a key stage of the processing. It gives you a look under the hood (or bonnet). So generally not useful (or necessary) for authors.
48
+ `pretext-enhanced-source.xsl` is mainly meant for development use. It outputs an XML file, which is not necessarily valid PreTeXt, at a key stage of the processing. It gives you a look under the hood (or bonnet). So generally not useful (or necessary) for authors.
28
49
 
29
50
  (Updated: 2020-02-25)
@@ -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
 
@@ -1,22 +1,22 @@
1
1
  <?xml version='1.0'?> <!-- As XML file -->
2
2
 
3
3
  <!--********************************************************************
4
- Copyright 2013 Robert A. Beezer
4
+ Copyright (C) 2013-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
  <!-- http://pimpmyxslt.com/articles/entity-tricks-part2/ -->
@@ -3,20 +3,20 @@
3
3
  <!--********************************************************************
4
4
  Copyright 2023 Jason Siefken
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
  <!--