@pretextbook/pretext-html 0.1.0 → 0.2.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 (106) hide show
  1. package/README.md +104 -4
  2. package/assets/preview-html.xsl +230 -230
  3. package/assets/upstream.json +7 -7
  4. package/assets/xsl/entities.ent +154 -154
  5. package/assets/xsl/extract-asymptote.xsl +68 -68
  6. package/assets/xsl/extract-biblio-csl.xsl +327 -327
  7. package/assets/xsl/extract-datafile.xsl +71 -71
  8. package/assets/xsl/extract-dynamic.xsl +139 -139
  9. package/assets/xsl/extract-identity.xsl +136 -136
  10. package/assets/xsl/extract-interactive.xsl +81 -81
  11. package/assets/xsl/extract-latex-image.xsl +118 -118
  12. package/assets/xsl/extract-mermaid.xsl +58 -58
  13. package/assets/xsl/extract-mom.xsl +63 -63
  14. package/assets/xsl/extract-pg.xsl +2897 -2897
  15. package/assets/xsl/extract-prefigure.xsl +157 -157
  16. package/assets/xsl/extract-qrcode.xsl +100 -100
  17. package/assets/xsl/extract-runestone-page-template.xsl +139 -139
  18. package/assets/xsl/extract-sageplot.xsl +166 -166
  19. package/assets/xsl/extract-stack.xsl +56 -56
  20. package/assets/xsl/extract-trace.xsl +134 -134
  21. package/assets/xsl/extract-youtube.xsl +63 -63
  22. package/assets/xsl/html-symbols.xsl +3344 -3344
  23. package/assets/xsl/latex/pretext-latex-AIM.xsl +56 -56
  24. package/assets/xsl/latex/pretext-latex-CLP.xsl +148 -148
  25. package/assets/xsl/latex/pretext-latex-chaos.xsl +317 -317
  26. package/assets/xsl/latex/pretext-latex-dyslexic-font.xsl +76 -76
  27. package/assets/xsl/latex/pretext-latex-guide.xsl +104 -104
  28. package/assets/xsl/latex/pretext-latex-texstyle.xsl +862 -862
  29. package/assets/xsl/localizations/af-ZA.xml +276 -276
  30. package/assets/xsl/localizations/bg-BG.xml +276 -276
  31. package/assets/xsl/localizations/ca-ES.xml +285 -285
  32. package/assets/xsl/localizations/cs-CZ.xml +280 -280
  33. package/assets/xsl/localizations/de-DE.xml +281 -281
  34. package/assets/xsl/localizations/en-US.xml +427 -427
  35. package/assets/xsl/localizations/es-ES.xml +287 -287
  36. package/assets/xsl/localizations/fi-FI.xml +275 -275
  37. package/assets/xsl/localizations/fr-CA.xml +276 -276
  38. package/assets/xsl/localizations/fr-FR.xml +280 -280
  39. package/assets/xsl/localizations/hu-HU.xml +280 -280
  40. package/assets/xsl/localizations/it-IT.xml +276 -276
  41. package/assets/xsl/localizations/ku-CKB.xml +275 -275
  42. package/assets/xsl/localizations/localizations.xml +48 -48
  43. package/assets/xsl/localizations/nl-NL.xml +275 -275
  44. package/assets/xsl/localizations/pt-BR.xml +288 -288
  45. package/assets/xsl/localizations/pt-PT.xml +292 -292
  46. package/assets/xsl/localizations/zh-HANS.xml +269 -269
  47. package/assets/xsl/pretext-assembly.xsl +4795 -4795
  48. package/assets/xsl/pretext-basic-html.xsl +86 -86
  49. package/assets/xsl/pretext-beamer.xsl +662 -662
  50. package/assets/xsl/pretext-braille-preprint.xsl +2249 -2249
  51. package/assets/xsl/pretext-common.xsl +12018 -12018
  52. package/assets/xsl/pretext-dynamic.xsl +65 -65
  53. package/assets/xsl/pretext-epub.xsl +1483 -1483
  54. package/assets/xsl/pretext-fo.xsl +4593 -4593
  55. package/assets/xsl/pretext-html.xsl +14791 -14791
  56. package/assets/xsl/pretext-json-manifest.xsl +150 -150
  57. package/assets/xsl/pretext-jupyter.xsl +868 -868
  58. package/assets/xsl/pretext-latex-classic.xsl +952 -952
  59. package/assets/xsl/pretext-latex-common.xsl +11563 -11563
  60. package/assets/xsl/pretext-latex.xsl +47 -47
  61. package/assets/xsl/pretext-litprog.xsl +105 -105
  62. package/assets/xsl/pretext-merge.xsl +41 -41
  63. package/assets/xsl/pretext-numbers.xsl +875 -875
  64. package/assets/xsl/pretext-revealjs.xsl +522 -522
  65. package/assets/xsl/pretext-runestone-fitb.xsl +1233 -1233
  66. package/assets/xsl/pretext-runestone-static.xsl +1438 -1438
  67. package/assets/xsl/pretext-runestone.xsl +3083 -3083
  68. package/assets/xsl/pretext-sage-doctest.xsl +289 -289
  69. package/assets/xsl/pretext-smc.xsl +492 -492
  70. package/assets/xsl/pretext-solution-manual-latex.xsl +323 -323
  71. package/assets/xsl/pretext-text-utilities.xsl +1217 -1217
  72. package/assets/xsl/pretext-text.xsl +392 -392
  73. package/assets/xsl/pretext-units.xsl +195 -195
  74. package/assets/xsl/pretext-view-source.xsl +157 -157
  75. package/assets/xsl/pretext-ww-problem-sets.xsl +391 -391
  76. package/assets/xsl/publisher-variables.xsl +4756 -4756
  77. package/assets/xsl/support/extract-math.xsl +256 -256
  78. package/assets/xsl/support/package-math.xsl +141 -141
  79. package/assets/xsl/support/play-button/play-button.svg +3 -3
  80. package/assets/xsl/support/pretext-pg-macros.xsl +110 -110
  81. package/assets/xsl/support/webpack_static_imports.xml +14 -14
  82. package/assets/xsl/tests/null.xml +3 -3
  83. package/assets/xsl/tests/pretext-text-utilities-test.xsl +333 -333
  84. package/assets/xsl/utilities/author-report.xsl +107 -107
  85. package/assets/xsl/utilities/deprecate-autoname.sed +18 -18
  86. package/assets/xsl/utilities/deprecate-index.sed +33 -33
  87. package/assets/xsl/utilities/fix-deprecations.xsl +663 -663
  88. package/assets/xsl/utilities/pretext-enhanced-source.xsl +112 -112
  89. package/assets/xsl/utilities/report-publisher-variables.xsl +162 -162
  90. package/assets/xsl/xml-to-json.xsl +326 -326
  91. package/assets/xsl/xml-to-string.xsl +328 -328
  92. package/assets/xsl-bundle.json +1 -0
  93. package/dist/{cli-C6tfAVvi.js → cli-B2LiKunq.js} +268 -233
  94. package/dist/cli.js +1 -1
  95. package/dist/host.browser.d.ts +29 -0
  96. package/dist/host.d.ts +41 -0
  97. package/dist/index.browser.d.ts +29 -0
  98. package/dist/index.browser.js +650 -0
  99. package/dist/index.d.ts +5 -0
  100. package/dist/index.js +16 -8
  101. package/dist/internal/posix-path.d.ts +59 -0
  102. package/dist/mounts.d.ts +18 -0
  103. package/dist/renderer.d.ts +14 -1
  104. package/dist/theme.d.ts +68 -0
  105. package/dist/theme.js +93 -0
  106. package/package.json +22 -4
@@ -1,141 +1,141 @@
1
- <?xml version='1.0'?>
2
-
3
- <!--********************************************************************
4
- Copyright 2020 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
- *********************************************************************-->
21
-
22
- <!-- This stylesheet expects the XHTML built by the extract-math.xsl -->
23
- <!-- stylesheet, to have been processed by MathJax 3 and Speech Rule -->
24
- <!-- Engine (SRE). The result, which as an organization created by -->
25
- <!-- the script from mathJax is here repackaged with PreTeXt -->
26
- <!-- internal elements (in a different namespace). -->
27
- <!-- The output is organized as follows: -->
28
- <!-- -->
29
- <!-- pi:math-representations -->
30
- <!-- pi:math -->
31
- <!-- ... -->
32
- <!-- pi:math -->
33
- <!-- svg/defs -->
34
- <!-- -->
35
- <!-- The multiple pi:math elements have -->
36
- <!-- @id: matches the id of its progenitor in the source -->
37
- <!-- @context: category of progenitor ("inline" v. "displaymath") -->
38
- <!-- div: one to four, with classes indicating content -->
39
- <!-- MathML and/or SVG (structured) -->
40
- <!-- braille, speech (raw content) -->
41
- <!-- -->
42
- <!-- The final element is a font cache, which -->
43
- <!-- has the @id attribute value "font-data" -->
44
-
45
- <xsl:stylesheet
46
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
47
- xmlns:xml="http://www.w3.org/XML/1998/namespace"
48
- xmlns:pi="http://pretextbook.org/2020/pretext/internal"
49
- xmlns:svg="http://www.w3.org/2000/svg"
50
- xmlns:math="http://www.w3.org/1998/Math/MathML"
51
- exclude-result-prefixes="svg"
52
- >
53
-
54
- <xsl:output method="xml" encoding="UTF-8"/>
55
-
56
- <!-- Our simple webpage is processed by MathJax via the mathjax-node-page -->
57
- <!-- program. This invocation is parameterized by a choice of SVG output -->
58
- <!-- or MathML output. Either way, the structure of the page is -->
59
- <!-- identical, so we seem to handle both simultaneously here. However, -->
60
- <!-- only one or the other is present. -->
61
-
62
- <!-- This is "pure" MathJax output, we leave adjustments to consumers -->
63
-
64
- <!-- Entry template, and cruiser -->
65
- <!-- We start here, and at each node, we simply descend, -->
66
- <!-- *unless* some template below kicks into action -->
67
- <xsl:template match="/|node()|@*">
68
- <xsl:apply-templates select="node()|@*"/>
69
- </xsl:template>
70
-
71
- <!-- We explicitly kill the LaTeX macro div, lest -->
72
- <!-- it get picked up as similar to the other math -->
73
- <xsl:template match="div[@id = 'latex-macros']"/>
74
-
75
- <!-- Body has what we want/need -->
76
- <xsl:template match="body">
77
- <pi:math-representations>
78
- <xsl:apply-templates select="node()|@*"/>
79
- <xsl:text>&#xa;&#xa;</xsl:text>
80
- </pi:math-representations>
81
- </xsl:template>
82
-
83
- <!-- Replace PreTeXt "div" w/ location info plus MJ "mjx-data" -->
84
- <!-- container by a consolidated PreteXt "pi:math" container -->
85
- <!-- with location info -->
86
- <xsl:template match="div/mjx-data">
87
- <xsl:text>&#xa;&#xa;</xsl:text>
88
- <pi:math>
89
- <!-- duplicate location, context info -->
90
- <xsl:copy-of select="../@*"/>
91
- <!-- pickup whatever gets produced by MJ/SRE script with -->
92
- <!-- its own containerization: MathML, SVG, braille, speech -->
93
- <xsl:apply-templates select="math:math|svg:svg|mjx-braille|mjx-speech"/>
94
- </pi:math>
95
- </xsl:template>
96
-
97
- <!-- Now duplicate actual representations (structured or -->
98
- <!-- raw content), always wrapped in an identifying div -->
99
-
100
- <xsl:template match="math:math">
101
- <div class="mathml">
102
- <xsl:copy-of select="."/>
103
- </div>
104
- </xsl:template>
105
-
106
- <xsl:template match="svg:svg">
107
- <div class="svg">
108
- <xsl:copy-of select="."/>
109
- </div>
110
- </xsl:template>
111
-
112
- <xsl:template match="mjx-braille">
113
- <div class="braille">
114
- <xsl:copy-of select="node()"/>
115
- </div>
116
- </xsl:template>
117
-
118
- <xsl:template match="mjx-speech">
119
- <div class="speech">
120
- <xsl:copy-of select="node()"/>
121
- </div>
122
- </xsl:template>
123
-
124
- <!-- SVG font (glyphs) cache -->
125
- <!-- Following depends on font caching behavior -->
126
- <!-- as passed to mathjax-node-page routine -->
127
- <!-- global cache: a pile of defs in a single SVG -->
128
- <!-- no caching: defs are per-SVG, no match here -->
129
- <!-- NB: need to have this prefixed with "body" to -->
130
- <!-- identify it as top-level, global situation, -->
131
- <!-- rather than local to each individual SVG -->
132
- <xsl:template match="body/svg:svg[svg:defs]">
133
- <xsl:copy>
134
- <xsl:attribute name="id">
135
- <xsl:text>font-data</xsl:text>
136
- </xsl:attribute>
137
- <xsl:apply-templates select="node()|@*"/>
138
- </xsl:copy>
139
- </xsl:template>
140
-
141
- </xsl:stylesheet>
1
+ <?xml version='1.0'?>
2
+
3
+ <!--********************************************************************
4
+ Copyright 2020 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
+ *********************************************************************-->
21
+
22
+ <!-- This stylesheet expects the XHTML built by the extract-math.xsl -->
23
+ <!-- stylesheet, to have been processed by MathJax 3 and Speech Rule -->
24
+ <!-- Engine (SRE). The result, which as an organization created by -->
25
+ <!-- the script from mathJax is here repackaged with PreTeXt -->
26
+ <!-- internal elements (in a different namespace). -->
27
+ <!-- The output is organized as follows: -->
28
+ <!-- -->
29
+ <!-- pi:math-representations -->
30
+ <!-- pi:math -->
31
+ <!-- ... -->
32
+ <!-- pi:math -->
33
+ <!-- svg/defs -->
34
+ <!-- -->
35
+ <!-- The multiple pi:math elements have -->
36
+ <!-- @id: matches the id of its progenitor in the source -->
37
+ <!-- @context: category of progenitor ("inline" v. "displaymath") -->
38
+ <!-- div: one to four, with classes indicating content -->
39
+ <!-- MathML and/or SVG (structured) -->
40
+ <!-- braille, speech (raw content) -->
41
+ <!-- -->
42
+ <!-- The final element is a font cache, which -->
43
+ <!-- has the @id attribute value "font-data" -->
44
+
45
+ <xsl:stylesheet
46
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
47
+ xmlns:xml="http://www.w3.org/XML/1998/namespace"
48
+ xmlns:pi="http://pretextbook.org/2020/pretext/internal"
49
+ xmlns:svg="http://www.w3.org/2000/svg"
50
+ xmlns:math="http://www.w3.org/1998/Math/MathML"
51
+ exclude-result-prefixes="svg"
52
+ >
53
+
54
+ <xsl:output method="xml" encoding="UTF-8"/>
55
+
56
+ <!-- Our simple webpage is processed by MathJax via the mathjax-node-page -->
57
+ <!-- program. This invocation is parameterized by a choice of SVG output -->
58
+ <!-- or MathML output. Either way, the structure of the page is -->
59
+ <!-- identical, so we seem to handle both simultaneously here. However, -->
60
+ <!-- only one or the other is present. -->
61
+
62
+ <!-- This is "pure" MathJax output, we leave adjustments to consumers -->
63
+
64
+ <!-- Entry template, and cruiser -->
65
+ <!-- We start here, and at each node, we simply descend, -->
66
+ <!-- *unless* some template below kicks into action -->
67
+ <xsl:template match="/|node()|@*">
68
+ <xsl:apply-templates select="node()|@*"/>
69
+ </xsl:template>
70
+
71
+ <!-- We explicitly kill the LaTeX macro div, lest -->
72
+ <!-- it get picked up as similar to the other math -->
73
+ <xsl:template match="div[@id = 'latex-macros']"/>
74
+
75
+ <!-- Body has what we want/need -->
76
+ <xsl:template match="body">
77
+ <pi:math-representations>
78
+ <xsl:apply-templates select="node()|@*"/>
79
+ <xsl:text>&#xa;&#xa;</xsl:text>
80
+ </pi:math-representations>
81
+ </xsl:template>
82
+
83
+ <!-- Replace PreTeXt "div" w/ location info plus MJ "mjx-data" -->
84
+ <!-- container by a consolidated PreteXt "pi:math" container -->
85
+ <!-- with location info -->
86
+ <xsl:template match="div/mjx-data">
87
+ <xsl:text>&#xa;&#xa;</xsl:text>
88
+ <pi:math>
89
+ <!-- duplicate location, context info -->
90
+ <xsl:copy-of select="../@*"/>
91
+ <!-- pickup whatever gets produced by MJ/SRE script with -->
92
+ <!-- its own containerization: MathML, SVG, braille, speech -->
93
+ <xsl:apply-templates select="math:math|svg:svg|mjx-braille|mjx-speech"/>
94
+ </pi:math>
95
+ </xsl:template>
96
+
97
+ <!-- Now duplicate actual representations (structured or -->
98
+ <!-- raw content), always wrapped in an identifying div -->
99
+
100
+ <xsl:template match="math:math">
101
+ <div class="mathml">
102
+ <xsl:copy-of select="."/>
103
+ </div>
104
+ </xsl:template>
105
+
106
+ <xsl:template match="svg:svg">
107
+ <div class="svg">
108
+ <xsl:copy-of select="."/>
109
+ </div>
110
+ </xsl:template>
111
+
112
+ <xsl:template match="mjx-braille">
113
+ <div class="braille">
114
+ <xsl:copy-of select="node()"/>
115
+ </div>
116
+ </xsl:template>
117
+
118
+ <xsl:template match="mjx-speech">
119
+ <div class="speech">
120
+ <xsl:copy-of select="node()"/>
121
+ </div>
122
+ </xsl:template>
123
+
124
+ <!-- SVG font (glyphs) cache -->
125
+ <!-- Following depends on font caching behavior -->
126
+ <!-- as passed to mathjax-node-page routine -->
127
+ <!-- global cache: a pile of defs in a single SVG -->
128
+ <!-- no caching: defs are per-SVG, no match here -->
129
+ <!-- NB: need to have this prefixed with "body" to -->
130
+ <!-- identify it as top-level, global situation, -->
131
+ <!-- rather than local to each individual SVG -->
132
+ <xsl:template match="body/svg:svg[svg:defs]">
133
+ <xsl:copy>
134
+ <xsl:attribute name="id">
135
+ <xsl:text>font-data</xsl:text>
136
+ </xsl:attribute>
137
+ <xsl:apply-templates select="node()|@*"/>
138
+ </xsl:copy>
139
+ </xsl:template>
140
+
141
+ </xsl:stylesheet>
@@ -1,3 +1,3 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 14 96 68" style="cursor:pointer; position: absolute; top: 0; left: 0; width: 100%; height: 100%;" preserveAspectRatio="none">
2
- <path fill="#e62117" d="M94.98,28.84c0,0-0.94-6.6-3.81-9.5c-3.64-3.81-7.72-3.83-9.59-4.05c-13.4-0.97-33.52-0.85-33.52-0.85s-20.12-0.12-33.52,0.85c-1.87,0.22-5.95,0.24-9.59,4.05c-2.87,2.9-3.81,9.5-3.81,9.5S0.18,36.58,0,44.33v7.26c0.18,7.75,1.14,15.49,1.14,15.49s0.93,6.6,3.81,9.5c3.64,3.81,8.43,3.69,10.56,4.09c7.53,0.72,31.7,0.89,32.54,0.9c0.01,0,20.14,0.03,33.54-0.94c1.87-0.22,5.95-0.24,9.59-4.05c2.87-2.9,3.81-9.5,3.81-9.5s0.96-7.75,1.02-15.49v-7.26C95.94,36.58,94.98,28.84,94.98,28.84z M38.28,61.41v-27l25.74,13.5L38.28,61.41z"/>
3
- </svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 14 96 68" style="cursor:pointer; position: absolute; top: 0; left: 0; width: 100%; height: 100%;" preserveAspectRatio="none">
2
+ <path fill="#e62117" d="M94.98,28.84c0,0-0.94-6.6-3.81-9.5c-3.64-3.81-7.72-3.83-9.59-4.05c-13.4-0.97-33.52-0.85-33.52-0.85s-20.12-0.12-33.52,0.85c-1.87,0.22-5.95,0.24-9.59,4.05c-2.87,2.9-3.81,9.5-3.81,9.5S0.18,36.58,0,44.33v7.26c0.18,7.75,1.14,15.49,1.14,15.49s0.93,6.6,3.81,9.5c3.64,3.81,8.43,3.69,10.56,4.09c7.53,0.72,31.7,0.89,32.54,0.9c0.01,0,20.14,0.03,33.54-0.94c1.87-0.22,5.95-0.24,9.59-4.05c2.87-2.9,3.81-9.5,3.81-9.5s0.96-7.75,1.02-15.49v-7.26C95.94,36.58,94.98,28.84,94.98,28.84z M38.28,61.41v-27l25.74,13.5L38.28,61.41z"/>
3
+ </svg>
@@ -1,110 +1,110 @@
1
- <?xml version="1.0" encoding="UTF-8" ?>
2
-
3
- <!-- ********************************************************************* -->
4
- <!-- Copyright 2021 -->
5
- <!-- Robert A. Beezer -->
6
- <!-- -->
7
- <!-- This file is part of PreTeXt. -->
8
- <!-- -->
9
- <!-- PreTeXt is free software: you can redistribute it and/or modify -->
10
- <!-- it under the terms of the GNU General Public License as published by -->
11
- <!-- the Free Software Foundation, either version 2 or version 3 of the -->
12
- <!-- License (at your option). -->
13
- <!-- -->
14
- <!-- PreTeXt is distributed in the hope that it will be useful, -->
15
- <!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
16
- <!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
17
- <!-- GNU General Public License for more details. -->
18
- <!-- -->
19
- <!-- You should have received a copy of the GNU General Public License -->
20
- <!-- along with PreTeXt. If not, see <http://www.gnu.org/licenses/>. -->
21
- <!-- ********************************************************************* -->
22
-
23
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
24
- xmlns:xml="http://www.w3.org/XML/1998/namespace"
25
- xmlns:exsl="http://exslt.org/common"
26
- xmlns:str="http://exslt.org/strings"
27
- extension-element-prefixes="exsl str"
28
- >
29
-
30
- <!-- This style sheet creates a perl library (.pl) file with WeBWorK PG -->
31
- <!-- macros that support WeBWorK problems authored in a PreTeXt project. -->
32
- <!-- Eventually when used by the pretext script, the name of the perl -->
33
- <!-- library file will be generated from the project title. -->
34
-
35
- <!-- Standard conversion groundwork -->
36
- <xsl:import href="../publisher-variables.xsl"/>
37
- <xsl:import href="../pretext-assembly.xsl"/>
38
- <xsl:import href="../pretext-common.xsl"/>
39
-
40
- <!-- We need to alert the pretext-assembly.xsl stylesheet -->
41
- <!-- that it is being used in the very specific instance -->
42
- <!-- of extracting these objects for processing externally, -->
43
- <!-- with results collected in additional files, for -->
44
- <!-- consultation/collection in a more general use of this -->
45
- <!-- stylesheet for the purpose of actually building a useful -->
46
- <!-- output format. This variable declaration here overrides -->
47
- <!-- the default setting of "false" in pretext-assembly.xsl. -->
48
- <!-- Look there for a more comprehensive discussion of the -->
49
- <!-- necessity of this scheme. -->
50
- <xsl:variable name="b-extracting-pg" select="true()"/>
51
-
52
- <!-- We are outputting perl code, and there is no reason to output -->
53
- <!-- anything other than "text" -->
54
- <xsl:output method="text" encoding="UTF-8" />
55
-
56
- <!--#######################################################################-->
57
- <!-- Entry Template -->
58
- <!--#######################################################################-->
59
-
60
- <xsl:template match="/">
61
- <xsl:variable name="macro-file-name">
62
- <xsl:choose>
63
- <xsl:when test="$docinfo/initialism">
64
- <xsl:value-of select="$docinfo/initialism"/>
65
- </xsl:when>
66
- <xsl:otherwise>
67
- <xsl:apply-templates select="$document-root" mode="title-filesafe"/>
68
- </xsl:otherwise>
69
- </xsl:choose>
70
- <text>.pl</text>
71
- </xsl:variable>
72
- <xsl:variable name="macro-file-content">
73
- <xsl:call-template name="header"/>
74
- <xsl:apply-templates select="$document-root" mode="latex-image-preamble"/>
75
- </xsl:variable>
76
- <exsl:document href="{$macro-file-name}" method="text">
77
- <xsl:call-template name="sanitize-text">
78
- <xsl:with-param name="text" select="$macro-file-content" />
79
- </xsl:call-template>
80
- </exsl:document>
81
- </xsl:template>
82
-
83
- <xsl:template match="book|article" mode="latex-image-preamble">
84
- <xsl:if test="$docinfo/latex-image-preamble">
85
- <xsl:text># Return a string containing the latex-image-preamble contents.&#xa;</xsl:text>
86
- <xsl:text># To be used by LaTeXImage objects as in:&#xa;</xsl:text>
87
- <xsl:text># $image->addToPreamble(latexImagePreamble())&#xa;</xsl:text>
88
- <xsl:text>&#xa;</xsl:text>
89
- <xsl:text>sub latexImagePreamble {&#xa;</xsl:text>
90
- <xsl:text>return &lt;&lt;'END_LATEX_IMAGE_PREAMBLE'&#xa;</xsl:text>
91
- <xsl:call-template name="sanitize-text">
92
- <xsl:with-param name="text" select="$docinfo/latex-image-preamble" />
93
- </xsl:call-template>
94
- <xsl:text>&#xa;</xsl:text>
95
- <xsl:text>END_LATEX_IMAGE_PREAMBLE&#xa;</xsl:text>
96
- <xsl:text>}&#xa;&#xa;</xsl:text>
97
- </xsl:if>
98
- </xsl:template>
99
-
100
- <xsl:template name="header">
101
- <xsl:text>#############################################################################&#xa;</xsl:text>
102
- <xsl:text># This macro library supports WeBWorK problems from the PreTeXt project named&#xa;</xsl:text>
103
- <xsl:text># </xsl:text>
104
- <xsl:apply-templates select="$document-root" mode="title-full" />
105
- <xsl:text>&#xa;</xsl:text>
106
- <xsl:text>#############################################################################&#xa;</xsl:text>
107
- <xsl:text>&#xa;&#xa;</xsl:text>
108
- </xsl:template>
109
-
110
- </xsl:stylesheet>
1
+ <?xml version="1.0" encoding="UTF-8" ?>
2
+
3
+ <!-- ********************************************************************* -->
4
+ <!-- Copyright 2021 -->
5
+ <!-- Robert A. Beezer -->
6
+ <!-- -->
7
+ <!-- This file is part of PreTeXt. -->
8
+ <!-- -->
9
+ <!-- PreTeXt is free software: you can redistribute it and/or modify -->
10
+ <!-- it under the terms of the GNU General Public License as published by -->
11
+ <!-- the Free Software Foundation, either version 2 or version 3 of the -->
12
+ <!-- License (at your option). -->
13
+ <!-- -->
14
+ <!-- PreTeXt is distributed in the hope that it will be useful, -->
15
+ <!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
16
+ <!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
17
+ <!-- GNU General Public License for more details. -->
18
+ <!-- -->
19
+ <!-- You should have received a copy of the GNU General Public License -->
20
+ <!-- along with PreTeXt. If not, see <http://www.gnu.org/licenses/>. -->
21
+ <!-- ********************************************************************* -->
22
+
23
+ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
24
+ xmlns:xml="http://www.w3.org/XML/1998/namespace"
25
+ xmlns:exsl="http://exslt.org/common"
26
+ xmlns:str="http://exslt.org/strings"
27
+ extension-element-prefixes="exsl str"
28
+ >
29
+
30
+ <!-- This style sheet creates a perl library (.pl) file with WeBWorK PG -->
31
+ <!-- macros that support WeBWorK problems authored in a PreTeXt project. -->
32
+ <!-- Eventually when used by the pretext script, the name of the perl -->
33
+ <!-- library file will be generated from the project title. -->
34
+
35
+ <!-- Standard conversion groundwork -->
36
+ <xsl:import href="../publisher-variables.xsl"/>
37
+ <xsl:import href="../pretext-assembly.xsl"/>
38
+ <xsl:import href="../pretext-common.xsl"/>
39
+
40
+ <!-- We need to alert the pretext-assembly.xsl stylesheet -->
41
+ <!-- that it is being used in the very specific instance -->
42
+ <!-- of extracting these objects for processing externally, -->
43
+ <!-- with results collected in additional files, for -->
44
+ <!-- consultation/collection in a more general use of this -->
45
+ <!-- stylesheet for the purpose of actually building a useful -->
46
+ <!-- output format. This variable declaration here overrides -->
47
+ <!-- the default setting of "false" in pretext-assembly.xsl. -->
48
+ <!-- Look there for a more comprehensive discussion of the -->
49
+ <!-- necessity of this scheme. -->
50
+ <xsl:variable name="b-extracting-pg" select="true()"/>
51
+
52
+ <!-- We are outputting perl code, and there is no reason to output -->
53
+ <!-- anything other than "text" -->
54
+ <xsl:output method="text" encoding="UTF-8" />
55
+
56
+ <!--#######################################################################-->
57
+ <!-- Entry Template -->
58
+ <!--#######################################################################-->
59
+
60
+ <xsl:template match="/">
61
+ <xsl:variable name="macro-file-name">
62
+ <xsl:choose>
63
+ <xsl:when test="$docinfo/initialism">
64
+ <xsl:value-of select="$docinfo/initialism"/>
65
+ </xsl:when>
66
+ <xsl:otherwise>
67
+ <xsl:apply-templates select="$document-root" mode="title-filesafe"/>
68
+ </xsl:otherwise>
69
+ </xsl:choose>
70
+ <text>.pl</text>
71
+ </xsl:variable>
72
+ <xsl:variable name="macro-file-content">
73
+ <xsl:call-template name="header"/>
74
+ <xsl:apply-templates select="$document-root" mode="latex-image-preamble"/>
75
+ </xsl:variable>
76
+ <exsl:document href="{$macro-file-name}" method="text">
77
+ <xsl:call-template name="sanitize-text">
78
+ <xsl:with-param name="text" select="$macro-file-content" />
79
+ </xsl:call-template>
80
+ </exsl:document>
81
+ </xsl:template>
82
+
83
+ <xsl:template match="book|article" mode="latex-image-preamble">
84
+ <xsl:if test="$docinfo/latex-image-preamble">
85
+ <xsl:text># Return a string containing the latex-image-preamble contents.&#xa;</xsl:text>
86
+ <xsl:text># To be used by LaTeXImage objects as in:&#xa;</xsl:text>
87
+ <xsl:text># $image->addToPreamble(latexImagePreamble())&#xa;</xsl:text>
88
+ <xsl:text>&#xa;</xsl:text>
89
+ <xsl:text>sub latexImagePreamble {&#xa;</xsl:text>
90
+ <xsl:text>return &lt;&lt;'END_LATEX_IMAGE_PREAMBLE'&#xa;</xsl:text>
91
+ <xsl:call-template name="sanitize-text">
92
+ <xsl:with-param name="text" select="$docinfo/latex-image-preamble" />
93
+ </xsl:call-template>
94
+ <xsl:text>&#xa;</xsl:text>
95
+ <xsl:text>END_LATEX_IMAGE_PREAMBLE&#xa;</xsl:text>
96
+ <xsl:text>}&#xa;&#xa;</xsl:text>
97
+ </xsl:if>
98
+ </xsl:template>
99
+
100
+ <xsl:template name="header">
101
+ <xsl:text>#############################################################################&#xa;</xsl:text>
102
+ <xsl:text># This macro library supports WeBWorK problems from the PreTeXt project named&#xa;</xsl:text>
103
+ <xsl:text># </xsl:text>
104
+ <xsl:apply-templates select="$document-root" mode="title-full" />
105
+ <xsl:text>&#xa;</xsl:text>
106
+ <xsl:text>#############################################################################&#xa;</xsl:text>
107
+ <xsl:text>&#xa;&#xa;</xsl:text>
108
+ </xsl:template>
109
+
110
+ </xsl:stylesheet>
@@ -1,14 +1,14 @@
1
- <?xml version="1.0" ?>
2
- <all>
3
- <js type="list">
4
- <item type="str">prefix-runtime.00db6230172ad960.bundle.js</item>
5
- <item type="str">prefix-347.8328b60515045466.bundle.js</item>
6
- <item type="str">prefix-runestone.aa624e4071d017c3.bundle.js</item>
7
- </js>
8
- <css type="list">
9
- <item type="str">prefix-347.f9add1ca35d5ad93.css</item>
10
- <item type="str">prefix-runestone.51d479d87f8466bb.css</item>
11
- </css>
12
- <cdn-url type="str">https://runestone.academy/cdn/runestone/</cdn-url>
13
- <version type="str">7.4.4</version>
14
- </all>
1
+ <?xml version="1.0" ?>
2
+ <all>
3
+ <js type="list">
4
+ <item type="str">prefix-runtime.00db6230172ad960.bundle.js</item>
5
+ <item type="str">prefix-347.8328b60515045466.bundle.js</item>
6
+ <item type="str">prefix-runestone.aa624e4071d017c3.bundle.js</item>
7
+ </js>
8
+ <css type="list">
9
+ <item type="str">prefix-347.f9add1ca35d5ad93.css</item>
10
+ <item type="str">prefix-runestone.51d479d87f8466bb.css</item>
11
+ </css>
12
+ <cdn-url type="str">https://runestone.academy/cdn/runestone/</cdn-url>
13
+ <version type="str">7.4.4</version>
14
+ </all>
@@ -1,4 +1,4 @@
1
- <?xml version="1.0" encoding="UTF-8" ?>
2
- <!-- intentionally empty valid XML file for use with pretext-text-utilities-text.xsl -->
3
- <nothing>
1
+ <?xml version="1.0" encoding="UTF-8" ?>
2
+ <!-- intentionally empty valid XML file for use with pretext-text-utilities-text.xsl -->
3
+ <nothing>
4
4
  </nothing>