@pretextbook/pretext-html 0.7.0 → 0.9.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.
- package/README.md +31 -2
- package/assets/preview-html.xsl +16 -0
- package/assets/upstream.json +1 -1
- package/assets/xsl/README.md +25 -24
- package/assets/xsl/entities.ent +11 -0
- package/assets/xsl/extract-dynamic.xsl +54 -3
- package/assets/xsl/extract-gdscript.xsl +61 -0
- package/assets/xsl/extract-sageplot.xsl +3 -0
- package/assets/xsl/localizations/README.md +24 -24
- package/assets/xsl/localizations/it-IT.xml +37 -41
- package/assets/xsl/pretext-assembly.xsl +190 -30
- package/assets/xsl/pretext-beamer.xsl +57 -12
- package/assets/xsl/pretext-common.xsl +175 -30
- package/assets/xsl/pretext-epub.xsl +4 -6
- package/assets/xsl/pretext-fo.xsl +127 -67
- package/assets/xsl/pretext-html.xsl +350 -94
- package/assets/xsl/pretext-jupyter.xsl +1 -0
- package/assets/xsl/pretext-latex-classic.xsl +2 -2
- package/assets/xsl/pretext-latex-common.xsl +296 -151
- package/assets/xsl/pretext-latex.xsl +16 -6
- package/assets/xsl/pretext-numbers.xsl +10 -0
- package/assets/xsl/pretext-revealjs.xsl +69 -4
- package/assets/xsl/pretext-runestone-fitb.xsl +179 -84
- package/assets/xsl/pretext-runestone-static.xsl +72 -20
- package/assets/xsl/pretext-runestone.xsl +32 -25
- package/assets/xsl/pretext-text-utilities.xsl +7 -0
- package/assets/xsl/pretext-text.xsl +17 -0
- package/assets/xsl/publisher-variables.xsl +109 -111
- package/assets/xsl/support/play-button/README.md +1 -3
- package/assets/xsl/tests/README.md +1 -1
- package/assets/xsl/utilities/README.md +6 -8
- package/assets/xsl-bundle.json +1 -1
- package/dist/cli-BUrNZxov.js +1098 -0
- package/dist/cli.js +1 -1
- package/dist/html-static.d.ts +20 -0
- package/dist/index.browser.js +598 -374
- package/dist/index.d.ts +4 -0
- package/dist/index.js +35 -30
- package/dist/renderer.d.ts +40 -1
- package/dist/skeleton.d.ts +41 -0
- package/dist/xrefs.d.ts +54 -0
- package/package.json +2 -1
- package/dist/cli-D0m0Ha1j.js +0 -856
|
@@ -224,6 +224,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
224
224
|
<xsl:variable name="b-has-myopenmath" select="boolean($document-root//myopenmath)"/>
|
|
225
225
|
<xsl:variable name="b-has-stack" select="boolean($document-root//exercise/stack)"/>
|
|
226
226
|
<xsl:variable name="b-has-program" select="boolean($document-root//program)"/>
|
|
227
|
+
<xsl:variable name="b-has-gdscript" select="boolean($document-root//program[@language='gdscript'])"/>
|
|
227
228
|
<xsl:variable name="b-has-sage" select="boolean($document-root//sage)"/>
|
|
228
229
|
<xsl:variable name="b-has-sfrac" select="boolean($document-root//m[contains(text(),'sfrac')] or $document-root//mrow[contains(text(),'sfrac')])" />
|
|
229
230
|
<xsl:variable name="b-has-geogebra" select="boolean($document-root//interactive[@platform='geogebra'])"/>
|
|
@@ -249,17 +250,6 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
249
250
|
<xsl:variable name="b-needs-custom-marker-css" select="boolean(exsl:node-set($ol-markers)/ol-markers/ol-marker)"/>
|
|
250
251
|
|
|
251
252
|
|
|
252
|
-
<!-- ######## -->
|
|
253
|
-
<!-- WeBWorK -->
|
|
254
|
-
<!-- ######## -->
|
|
255
|
-
|
|
256
|
-
<!-- We mine some values from the first "WW representation" to have been -->
|
|
257
|
-
<!-- inserted into the source by the pre-processor ("assembly") when -->
|
|
258
|
-
<!-- making dynamic exercises. -->
|
|
259
|
-
|
|
260
|
-
<xsl:variable name="webwork-major-version" select="$document-root//webwork-reps[1]/@webwork2_major_version"/>
|
|
261
|
-
<xsl:variable name="webwork-minor-version" select="$document-root//webwork-reps[1]/@webwork2_minor_version"/>
|
|
262
|
-
|
|
263
253
|
<!-- #### EXPERIMENTAL #### -->
|
|
264
254
|
<!-- We allow for the HTML conversion to chunk output, starting -->
|
|
265
255
|
<!-- from an arbitrary node. $subtree-node needs context. -->
|
|
@@ -505,8 +495,9 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
505
495
|
<xsl:with-param name="heading-level" select="$chunk-heading-level"/>
|
|
506
496
|
</xsl:apply-templates>
|
|
507
497
|
</xsl:with-param>
|
|
508
|
-
<!-- Set b-has-printout to true if the structural node is or contains a
|
|
509
|
-
|
|
498
|
+
<!-- Set b-has-printout to true if the structural node is or contains a -->
|
|
499
|
+
<!-- worksheet or handout, or a PROJECT-LIKE acting as its own printout. -->
|
|
500
|
+
<xsl:with-param name="b-has-printout" select="descendant-or-self::worksheet or descendant-or-self::handout or descendant::*[&PROJECT-FILTER;][not(ancestor::worksheet|ancestor::handout)][@workspace|.//@workspace]"/>
|
|
510
501
|
</xsl:apply-templates>
|
|
511
502
|
</xsl:template>
|
|
512
503
|
|
|
@@ -561,6 +552,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
561
552
|
<xsl:if test="not($num = '')">
|
|
562
553
|
<span class="codenumber">
|
|
563
554
|
<xsl:value-of select="$num" />
|
|
555
|
+
<xsl:apply-templates select="." mode="division-number-separator"/>
|
|
564
556
|
</span>
|
|
565
557
|
<xsl:text> </xsl:text>
|
|
566
558
|
</xsl:if>
|
|
@@ -982,6 +974,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
982
974
|
<xsl:call-template name="space-styled"/>
|
|
983
975
|
<span class="codenumber">
|
|
984
976
|
<xsl:apply-templates select="." mode="number" />
|
|
977
|
+
<xsl:apply-templates select="." mode="division-number-separator"/>
|
|
985
978
|
</span>
|
|
986
979
|
<xsl:call-template name="space-styled"/>
|
|
987
980
|
<span class="title">
|
|
@@ -1025,7 +1018,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
1025
1018
|
<!-- print previews. A simple button with printer icon that reloads -->
|
|
1026
1019
|
<!-- the page with a url parameter that tells javascript to switch -->
|
|
1027
1020
|
<!-- to printout css and format all the pages and workspace. -->
|
|
1028
|
-
<xsl:template match="&PRINTOUT;" mode="standalone-printout-links">
|
|
1021
|
+
<xsl:template match="&PRINTOUT;|&PROJECT-LIKE;" mode="standalone-printout-links">
|
|
1029
1022
|
<xsl:variable name="printout-id">
|
|
1030
1023
|
<xsl:apply-templates select="." mode="html-id"/>
|
|
1031
1024
|
</xsl:variable>
|
|
@@ -1175,6 +1168,12 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
1175
1168
|
</xsl:template>
|
|
1176
1169
|
|
|
1177
1170
|
<xsl:template match="affiliation">
|
|
1171
|
+
<xsl:if test="position">
|
|
1172
|
+
<xsl:apply-templates select="position" />
|
|
1173
|
+
<xsl:if test="position/following-sibling::*">
|
|
1174
|
+
<br />
|
|
1175
|
+
</xsl:if>
|
|
1176
|
+
</xsl:if>
|
|
1178
1177
|
<xsl:if test="department">
|
|
1179
1178
|
<xsl:apply-templates select="department" />
|
|
1180
1179
|
<xsl:if test="department/following-sibling::*">
|
|
@@ -1196,11 +1195,11 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
1196
1195
|
</xsl:template>
|
|
1197
1196
|
|
|
1198
1197
|
<!-- Departments and Institutions are free-form, or sequences of lines -->
|
|
1199
|
-
<xsl:template match="department|institution|location">
|
|
1198
|
+
<xsl:template match="position|department|institution|location">
|
|
1200
1199
|
<xsl:apply-templates/>
|
|
1201
1200
|
</xsl:template>
|
|
1202
1201
|
|
|
1203
|
-
<xsl:template match="department[line]|institution[line]|location[line]">
|
|
1202
|
+
<xsl:template match="position[line]|department[line]|institution[line]|location[line]">
|
|
1204
1203
|
<xsl:apply-templates select="line" />
|
|
1205
1204
|
</xsl:template>
|
|
1206
1205
|
|
|
@@ -1215,10 +1214,11 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
1215
1214
|
</div>
|
|
1216
1215
|
</xsl:template>
|
|
1217
1216
|
|
|
1218
|
-
<!-- General support (not for a particular author) -->
|
|
1217
|
+
<!-- General support (not for a particular author). The schema -->
|
|
1218
|
+
<!-- says a "support" statement is text-level, mixed content -->
|
|
1219
1219
|
<xsl:template match="bibinfo/support">
|
|
1220
1220
|
<div class="support">
|
|
1221
|
-
<xsl:apply-templates select="
|
|
1221
|
+
<xsl:apply-templates select="node()"/>
|
|
1222
1222
|
</div>
|
|
1223
1223
|
</xsl:template>
|
|
1224
1224
|
|
|
@@ -1751,11 +1751,25 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
1751
1751
|
<!-- https://stackoverflow.com/questions/538293/find-common-parent-using-xpath -->
|
|
1752
1752
|
<xsl:variable name="nearest-common-ancestor"
|
|
1753
1753
|
select="./ancestor::*[count(. | $link/ancestor::*) = count($link/ancestor::*)] [1]"/>
|
|
1754
|
-
<xsl:
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1754
|
+
<xsl:choose>
|
|
1755
|
+
<!-- A division's "introduction" or "conclusion" renders on -->
|
|
1756
|
+
<!-- its division's page, whole, whatever the chunk level. -->
|
|
1757
|
+
<!-- So a link and target together inside one companion are -->
|
|
1758
|
+
<!-- always on one page, though the companion's level would -->
|
|
1759
|
+
<!-- say otherwise. Deliberately a containment test, not -->
|
|
1760
|
+
<!-- level arithmetic: the levels of these companions are -->
|
|
1761
|
+
<!-- slated for rework. -->
|
|
1762
|
+
<xsl:when test="$nearest-common-ancestor/ancestor-or-self::introduction[parent::*[&STRUCTURAL-FILTER;]] or $nearest-common-ancestor/ancestor-or-self::conclusion[parent::*[&STRUCTURAL-FILTER;]]">
|
|
1763
|
+
<xsl:value-of select="false()"/>
|
|
1764
|
+
</xsl:when>
|
|
1765
|
+
<xsl:otherwise>
|
|
1766
|
+
<xsl:variable name="nearest-ancestor-level">
|
|
1767
|
+
<xsl:apply-templates select="$nearest-common-ancestor" mode="enclosing-level"/>
|
|
1768
|
+
</xsl:variable>
|
|
1769
|
+
<!-- remove not(), replace operator with <, then radically different behavior -->
|
|
1770
|
+
<xsl:value-of select="not($nearest-ancestor-level >= $chunk-level)"/>
|
|
1771
|
+
</xsl:otherwise>
|
|
1772
|
+
</xsl:choose>
|
|
1759
1773
|
</xsl:otherwise>
|
|
1760
1774
|
</xsl:choose>
|
|
1761
1775
|
</xsl:template>
|
|
@@ -2745,6 +2759,35 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
2745
2759
|
<!-- Footnotes -->
|
|
2746
2760
|
<!-- ######### -->
|
|
2747
2761
|
|
|
2762
|
+
<!-- A table note ("tn") drops only its superscript letter mark at the -->
|
|
2763
|
+
<!-- cell location, linked to the note text collected below the table -->
|
|
2764
|
+
<!-- in the "tabular-inclusion" template. Letters count per-tabular -->
|
|
2765
|
+
<!-- in document order (Notes to tables: CMoS 18th ed., 3.77-3.81; -->
|
|
2766
|
+
<!-- specific notes at 3.80). Adjacency is the presentation: a note -->
|
|
2767
|
+
<!-- sits just below its table, so there is no knowl. -->
|
|
2768
|
+
<xsl:template match="tabular//tn">
|
|
2769
|
+
<xsl:variable name="note-number">
|
|
2770
|
+
<xsl:apply-templates select="." mode="number"/>
|
|
2771
|
+
</xsl:variable>
|
|
2772
|
+
<sup class="tablenote-mark">
|
|
2773
|
+
<xsl:apply-templates select="." mode="html-id-attribute"/>
|
|
2774
|
+
<a>
|
|
2775
|
+
<xsl:attribute name="href">
|
|
2776
|
+
<xsl:text>#</xsl:text>
|
|
2777
|
+
<xsl:apply-templates select="." mode="html-id"/>
|
|
2778
|
+
<xsl:text>-note</xsl:text>
|
|
2779
|
+
</xsl:attribute>
|
|
2780
|
+
<xsl:attribute name="aria-label">
|
|
2781
|
+
<xsl:text>Go to table note </xsl:text>
|
|
2782
|
+
<xsl:value-of select="$note-number"/>
|
|
2783
|
+
</xsl:attribute>
|
|
2784
|
+
<i>
|
|
2785
|
+
<xsl:value-of select="$note-number"/>
|
|
2786
|
+
</i>
|
|
2787
|
+
</a>
|
|
2788
|
+
</sup>
|
|
2789
|
+
</xsl:template>
|
|
2790
|
+
|
|
2748
2791
|
<!-- Currently implemented as a details html element with no guardrails -->
|
|
2749
2792
|
<!-- on nested content. Other footnotes, block content, etc... will all -->
|
|
2750
2793
|
<!-- be rendered, but perhaps not well. Caveat emptor. -->
|
|
@@ -4046,17 +4089,42 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
4046
4089
|
</xsl:template>
|
|
4047
4090
|
|
|
4048
4091
|
<!-- And its CSS class -->
|
|
4092
|
+
<!-- A project acting as a standalone printout is marked as such, so the -->
|
|
4093
|
+
<!-- stylesheet can treat it as the printable thing it is (for one, its -->
|
|
4094
|
+
<!-- title gets a line of its own rather than running into the text). -->
|
|
4049
4095
|
<xsl:template match="&PROJECT-LIKE;" mode="body-css-class">
|
|
4050
4096
|
<xsl:value-of select="local-name()"/>
|
|
4051
4097
|
<xsl:text> project-like</xsl:text>
|
|
4098
|
+
<xsl:variable name="b-standalone-printout">
|
|
4099
|
+
<xsl:apply-templates select="." mode="is-standalone-printout"/>
|
|
4100
|
+
</xsl:variable>
|
|
4101
|
+
<xsl:if test="$b-standalone-printout = 'true'">
|
|
4102
|
+
<xsl:text> standalone-printout</xsl:text>
|
|
4103
|
+
</xsl:if>
|
|
4052
4104
|
</xsl:template>
|
|
4053
4105
|
|
|
4054
4106
|
<!-- When born use this heading -->
|
|
4107
|
+
<!-- A standalone printout earns a print preview icon. Unlike a printout, -->
|
|
4108
|
+
<!-- whose icon lives inside its heading, a project's icon is a sibling -->
|
|
4109
|
+
<!-- following the heading: a project's title is a styled thing in its own -->
|
|
4110
|
+
<!-- right in several themes (a boxed legend, a filled bar), and the icon -->
|
|
4111
|
+
<!-- has no business inside that. As a floated sibling it lands just -->
|
|
4112
|
+
<!-- below the title at the right, clear of the title's decoration. -->
|
|
4113
|
+
<!-- NB: a project born hidden as a knowl (the publisher's knowl-project) -->
|
|
4114
|
+
<!-- also comes through here, putting the icon in the knowl's "summary", -->
|
|
4115
|
+
<!-- the only place it is visible while the knowl is closed. The preview -->
|
|
4116
|
+
<!-- javascript ("flattenKnowledPrintout") knows how to unpack that. -->
|
|
4055
4117
|
<xsl:template match="&PROJECT-LIKE;" mode="heading-birth">
|
|
4056
4118
|
<xsl:param name="heading-level"/>
|
|
4057
4119
|
<xsl:apply-templates select="." mode="heading-full">
|
|
4058
4120
|
<xsl:with-param name="heading-level" select="$heading-level"/>
|
|
4059
4121
|
</xsl:apply-templates>
|
|
4122
|
+
<xsl:variable name="b-standalone-printout">
|
|
4123
|
+
<xsl:apply-templates select="." mode="is-standalone-printout"/>
|
|
4124
|
+
</xsl:variable>
|
|
4125
|
+
<xsl:if test="$b-standalone-printout = 'true'">
|
|
4126
|
+
<xsl:apply-templates select="." mode="standalone-printout-links"/>
|
|
4127
|
+
</xsl:if>
|
|
4060
4128
|
</xsl:template>
|
|
4061
4129
|
|
|
4062
4130
|
<!-- When used in solutions -->
|
|
@@ -5424,6 +5492,10 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
5424
5492
|
<xsl:if test="$b-original and not($block-type = 'hidden')">
|
|
5425
5493
|
<xsl:apply-templates select="." mode="html-id-attribute"/>
|
|
5426
5494
|
</xsl:if>
|
|
5495
|
+
<!-- Both are empty unless this block is a standalone printout, -->
|
|
5496
|
+
<!-- ie a PROJECT-LIKE with workspace outside of any printout. -->
|
|
5497
|
+
<xsl:apply-templates select="." mode="page-margins-attribute"/>
|
|
5498
|
+
<xsl:apply-templates select="." mode="page-header-footer-attributes"/>
|
|
5427
5499
|
<!-- If visible, heading interior to article -->
|
|
5428
5500
|
<xsl:if test="$block-type = 'visible'">
|
|
5429
5501
|
<xsl:apply-templates select="." mode="heading-birth">
|
|
@@ -6042,10 +6114,11 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
6042
6114
|
</xsl:element>
|
|
6043
6115
|
</xsl:template>
|
|
6044
6116
|
|
|
6045
|
-
<!-- A "headnote" prefaces the
|
|
6046
|
-
<!--
|
|
6047
|
-
<!--
|
|
6048
|
-
|
|
6117
|
+
<!-- A "headnote" prefaces the list of a list-like division: a -->
|
|
6118
|
+
<!-- "glossary", a "references", an "index", an "appendix" -->
|
|
6119
|
+
<!-- that is a notation list. Below is modeled on block -->
|
|
6120
|
+
<!-- introductions (just above), but with no "title". -->
|
|
6121
|
+
<xsl:template match="glossary/headnote|references/headnote|index/headnote|appendix/headnote">
|
|
6049
6122
|
<xsl:param name="b-original" select="true()" />
|
|
6050
6123
|
<section class="headnote">
|
|
6051
6124
|
<xsl:if test="$b-original">
|
|
@@ -6422,16 +6495,14 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
6422
6495
|
<!-- $base-pathname needed later for archive links -->
|
|
6423
6496
|
<xsl:variable name="base-pathname">
|
|
6424
6497
|
<xsl:value-of select="$generated-directory"/>
|
|
6425
|
-
<xsl:
|
|
6426
|
-
<xsl:
|
|
6427
|
-
<xsl:
|
|
6428
|
-
|
|
6429
|
-
|
|
6430
|
-
<xsl:
|
|
6431
|
-
|
|
6432
|
-
|
|
6433
|
-
</xsl:choose>
|
|
6434
|
-
</xsl:if>
|
|
6498
|
+
<xsl:choose>
|
|
6499
|
+
<xsl:when test="latex-image">
|
|
6500
|
+
<xsl:text>latex-image/</xsl:text>
|
|
6501
|
+
</xsl:when>
|
|
6502
|
+
<xsl:when test="pf:prefigure">
|
|
6503
|
+
<xsl:text>prefigure/</xsl:text>
|
|
6504
|
+
</xsl:when>
|
|
6505
|
+
</xsl:choose>
|
|
6435
6506
|
<!-- NB: node-set in @select will have exactly -->
|
|
6436
6507
|
<!-- one (child) node, given @match above -->
|
|
6437
6508
|
<xsl:apply-templates select="latex-image|pf:prefigure" mode="image-source-basename"/>
|
|
@@ -6487,9 +6558,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
6487
6558
|
<!-- $base-pathname needed later for archive links -->
|
|
6488
6559
|
<xsl:variable name="base-pathname">
|
|
6489
6560
|
<xsl:value-of select="$generated-directory"/>
|
|
6490
|
-
<xsl:
|
|
6491
|
-
<xsl:text>sageplot/</xsl:text>
|
|
6492
|
-
</xsl:if>
|
|
6561
|
+
<xsl:text>sageplot/</xsl:text>
|
|
6493
6562
|
<xsl:apply-templates select="sageplot" mode="image-source-basename"/>
|
|
6494
6563
|
</xsl:variable>
|
|
6495
6564
|
<!-- 2d are SVG, 3d are HTML -->
|
|
@@ -6527,9 +6596,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
6527
6596
|
<!-- for source analysis. -->
|
|
6528
6597
|
<xsl:variable name="base-pathname">
|
|
6529
6598
|
<xsl:value-of select="$generated-directory"/>
|
|
6530
|
-
<xsl:
|
|
6531
|
-
<xsl:text>asymptote/</xsl:text>
|
|
6532
|
-
</xsl:if>
|
|
6599
|
+
<xsl:text>asymptote/</xsl:text>
|
|
6533
6600
|
<xsl:apply-templates select="asymptote" mode="image-source-basename"/>
|
|
6534
6601
|
</xsl:variable>
|
|
6535
6602
|
<xsl:variable name="html-filename" select="concat($base-pathname, '.html')" />
|
|
@@ -6538,9 +6605,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
6538
6605
|
<!-- insert correctly as a scaled instance -->
|
|
6539
6606
|
<xsl:variable name="html-source-filename">
|
|
6540
6607
|
<xsl:value-of select="$generated-directory-source"/>
|
|
6541
|
-
<xsl:
|
|
6542
|
-
<xsl:text>asymptote/</xsl:text>
|
|
6543
|
-
</xsl:if>
|
|
6608
|
+
<xsl:text>asymptote/</xsl:text>
|
|
6544
6609
|
<xsl:apply-templates select="asymptote" mode="image-source-basename"/>
|
|
6545
6610
|
<xsl:text>.html</xsl:text>
|
|
6546
6611
|
</xsl:variable>
|
|
@@ -6679,16 +6744,14 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
6679
6744
|
<!-- Get the filename of the generated svg file -->
|
|
6680
6745
|
<xsl:variable name="svg-source-filename">
|
|
6681
6746
|
<xsl:value-of select="$generated-directory-source" />
|
|
6682
|
-
<xsl:
|
|
6683
|
-
<xsl:
|
|
6684
|
-
<xsl:
|
|
6685
|
-
|
|
6686
|
-
|
|
6687
|
-
<xsl:
|
|
6688
|
-
|
|
6689
|
-
|
|
6690
|
-
</xsl:choose>
|
|
6691
|
-
</xsl:if>
|
|
6747
|
+
<xsl:choose>
|
|
6748
|
+
<xsl:when test="latex-image">
|
|
6749
|
+
<xsl:text>latex-image/</xsl:text>
|
|
6750
|
+
</xsl:when>
|
|
6751
|
+
<xsl:when test="pf:prefigure">
|
|
6752
|
+
<xsl:text>prefigure/</xsl:text>
|
|
6753
|
+
</xsl:when>
|
|
6754
|
+
</xsl:choose>
|
|
6692
6755
|
<xsl:apply-templates select="latex-image|pf:prefigure" mode="image-source-basename"/>
|
|
6693
6756
|
<xsl:text>.svg</xsl:text>
|
|
6694
6757
|
</xsl:variable>
|
|
@@ -8121,6 +8184,44 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
8121
8184
|
<xsl:with-param name="ambient-relative-width" select="$width" />
|
|
8122
8185
|
</xsl:apply-templates>
|
|
8123
8186
|
</table>
|
|
8187
|
+
<!-- Table notes ("tn") collect just below the table, lettered in -->
|
|
8188
|
+
<!-- reading order, which is document order of the marks (Notes -->
|
|
8189
|
+
<!-- to tables: CMoS 18th ed., 3.77-3.81; specific notes at -->
|
|
8190
|
+
<!-- 3.80). Disjoint from true footnote numbering. -->
|
|
8191
|
+
<xsl:if test=".//tn">
|
|
8192
|
+
<!-- each note is a list item (not a "p"): one tight -->
|
|
8193
|
+
<!-- line per note, free of paragraph margins -->
|
|
8194
|
+
<ol class="tablenotes" aria-label="Table notes">
|
|
8195
|
+
<xsl:for-each select=".//tn">
|
|
8196
|
+
<xsl:variable name="note-number">
|
|
8197
|
+
<xsl:apply-templates select="." mode="number"/>
|
|
8198
|
+
</xsl:variable>
|
|
8199
|
+
<li class="tablenote">
|
|
8200
|
+
<xsl:attribute name="id">
|
|
8201
|
+
<xsl:apply-templates select="." mode="html-id"/>
|
|
8202
|
+
<xsl:text>-note</xsl:text>
|
|
8203
|
+
</xsl:attribute>
|
|
8204
|
+
<sup>
|
|
8205
|
+
<a>
|
|
8206
|
+
<xsl:attribute name="href">
|
|
8207
|
+
<xsl:text>#</xsl:text>
|
|
8208
|
+
<xsl:apply-templates select="." mode="html-id"/>
|
|
8209
|
+
</xsl:attribute>
|
|
8210
|
+
<xsl:attribute name="aria-label">
|
|
8211
|
+
<xsl:text>Back to table note reference </xsl:text>
|
|
8212
|
+
<xsl:value-of select="$note-number"/>
|
|
8213
|
+
</xsl:attribute>
|
|
8214
|
+
<i>
|
|
8215
|
+
<xsl:value-of select="$note-number"/>
|
|
8216
|
+
</i>
|
|
8217
|
+
</a>
|
|
8218
|
+
</sup>
|
|
8219
|
+
<xsl:text> </xsl:text>
|
|
8220
|
+
<xsl:apply-templates/>
|
|
8221
|
+
</li>
|
|
8222
|
+
</xsl:for-each>
|
|
8223
|
+
</ol>
|
|
8224
|
+
</xsl:if>
|
|
8124
8225
|
</xsl:template>
|
|
8125
8226
|
|
|
8126
8227
|
<!-- A row of table -->
|
|
@@ -9049,8 +9150,13 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
9049
9150
|
</code>
|
|
9050
9151
|
</xsl:template>
|
|
9051
9152
|
|
|
9153
|
+
<!-- A copy button serves a block of code; within a "tabular" -->
|
|
9154
|
+
<!-- cell the content is short and the floating button crowds -->
|
|
9155
|
+
<!-- the cell, so there we decline to provide one. -->
|
|
9052
9156
|
<xsl:template name="insert-clipboardable-class">
|
|
9053
|
-
<xsl:
|
|
9157
|
+
<xsl:if test="not(ancestor::tabular)">
|
|
9158
|
+
<xsl:text> clipboardable</xsl:text>
|
|
9159
|
+
</xsl:if>
|
|
9054
9160
|
</xsl:template>
|
|
9055
9161
|
|
|
9056
9162
|
<!-- 100% analogue of LaTeX's verbatim -->
|
|
@@ -10352,30 +10458,30 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
10352
10458
|
</xsl:template>
|
|
10353
10459
|
|
|
10354
10460
|
<!-- HTML Code -->
|
|
10355
|
-
<!-- Simply create deep-copy of HTML elements -->
|
|
10356
10461
|
<!-- TODO: should this be a div, with width and height? -->
|
|
10357
|
-
<!-- Authored HTML goes into the page
|
|
10358
|
-
<!--
|
|
10359
|
-
<!--
|
|
10360
|
-
<!--
|
|
10361
|
-
<!--
|
|
10362
|
-
<!--
|
|
10363
|
-
<!--
|
|
10462
|
+
<!-- Authored HTML goes into the page, which is the content's -->
|
|
10463
|
+
<!-- only destination, and an HTML parser has no notion of -->
|
|
10464
|
+
<!-- namespaces. So the copy keeps just the local name of each -->
|
|
10465
|
+
<!-- element: an author declares the XHTML namespace once (say, -->
|
|
10466
|
+
<!-- a prefix on the "slate") to satisfy validation, and the -->
|
|
10467
|
+
<!-- output carries plain HTML tags with no declarations at -->
|
|
10468
|
+
<!-- all. (This utility may serve other embedded-markup -->
|
|
10469
|
+
<!-- copying; nothing about it is specific to a "slate".) -->
|
|
10364
10470
|
<xsl:template match="slate[@surface = 'html']">
|
|
10365
|
-
<xsl:apply-templates select="*" mode="copy-authored-
|
|
10471
|
+
<xsl:apply-templates select="*" mode="copy-authored-xml"/>
|
|
10366
10472
|
</xsl:template>
|
|
10367
10473
|
|
|
10368
10474
|
<!-- Attributes in the internal namespace are the assembly's -->
|
|
10369
10475
|
<!-- identification stamps, not the author's work, so they stay -->
|
|
10370
10476
|
<!-- out of the copy. -->
|
|
10371
|
-
<xsl:template match="*" mode="copy-authored-
|
|
10372
|
-
<xsl:element name="{name()}"
|
|
10477
|
+
<xsl:template match="*" mode="copy-authored-xml">
|
|
10478
|
+
<xsl:element name="{local-name()}">
|
|
10373
10479
|
<xsl:copy-of select="@*[namespace-uri(.) != 'http://pretextbook.org/2020/pretext/internal']"/>
|
|
10374
|
-
<xsl:apply-templates select="node()" mode="copy-authored-
|
|
10480
|
+
<xsl:apply-templates select="node()" mode="copy-authored-xml"/>
|
|
10375
10481
|
</xsl:element>
|
|
10376
10482
|
</xsl:template>
|
|
10377
10483
|
|
|
10378
|
-
<xsl:template match="text()|comment()|processing-instruction()" mode="copy-authored-
|
|
10484
|
+
<xsl:template match="text()|comment()|processing-instruction()" mode="copy-authored-xml">
|
|
10379
10485
|
<xsl:copy/>
|
|
10380
10486
|
</xsl:template>
|
|
10381
10487
|
|
|
@@ -10763,11 +10869,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
10763
10869
|
<xsl:when test="substring($raw-location,1,4) = 'http'">
|
|
10764
10870
|
<xsl:value-of select="$raw-location"/>
|
|
10765
10871
|
</xsl:when>
|
|
10766
|
-
<xsl:when test="not($b-managed-directories)">
|
|
10767
|
-
<xsl:value-of select="$raw-location"/>
|
|
10768
|
-
</xsl:when>
|
|
10769
10872
|
<xsl:otherwise>
|
|
10770
|
-
<!-- empty when not using managed directories -->
|
|
10771
10873
|
<xsl:value-of select="$external-directory"/>
|
|
10772
10874
|
<xsl:value-of select="$raw-location"/>
|
|
10773
10875
|
</xsl:otherwise>
|
|
@@ -10797,11 +10899,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
10797
10899
|
<xsl:when test="substring($raw-location,1,4) = 'http'">
|
|
10798
10900
|
<xsl:value-of select="$raw-location"/>
|
|
10799
10901
|
</xsl:when>
|
|
10800
|
-
<xsl:when test="not($b-managed-directories)">
|
|
10801
|
-
<xsl:value-of select="$raw-location"/>
|
|
10802
|
-
</xsl:when>
|
|
10803
10902
|
<xsl:otherwise>
|
|
10804
|
-
<!-- empty when not using managed directories -->
|
|
10805
10903
|
<xsl:value-of select="$external-directory"/>
|
|
10806
10904
|
<xsl:value-of select="$raw-location"/>
|
|
10807
10905
|
</xsl:otherwise>
|
|
@@ -11085,7 +11183,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
11085
11183
|
<!-- WeBWorK Javascript header -->
|
|
11086
11184
|
<xsl:template name="webwork-js">
|
|
11087
11185
|
<xsl:if test="$b-has-webwork-reps">
|
|
11088
|
-
<script src="{$html.js.dir}/pretext-webwork
|
|
11186
|
+
<script src="{$html.js.dir}/pretext-webwork.js"></script>
|
|
11089
11187
|
<script src="{$webwork-server}/webwork2_files/node_modules/iframe-resizer/js/iframeResizer.min.js"></script>
|
|
11090
11188
|
</xsl:if>
|
|
11091
11189
|
</xsl:template>
|
|
@@ -11156,19 +11254,22 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
11156
11254
|
<xsl:param name="b-has-answer"/>
|
|
11157
11255
|
<xsl:param name="b-has-solution"/>
|
|
11158
11256
|
|
|
11159
|
-
<!-- For Runestone, the WW problem is handled in isolation,
|
|
11160
|
-
<!-- yet capturing and storing student work/results needs
|
|
11161
|
-
<!-- to be associated with the parent/enclosing "exercise"
|
|
11162
|
-
<!-- (or PROJECT-LIKE). So in this case (only) we place
|
|
11163
|
-
<!-- an id value on the div.exercise-wrapper that is
|
|
11164
|
-
<!-- derived from the parent. Otherwise, we use the
|
|
11165
|
-
<!--
|
|
11166
|
-
<!--
|
|
11167
|
-
<!--
|
|
11168
|
-
<!--
|
|
11169
|
-
<!--
|
|
11170
|
-
<!--
|
|
11171
|
-
<!--
|
|
11257
|
+
<!-- For Runestone, the WW problem is handled in isolation, -->
|
|
11258
|
+
<!-- yet capturing and storing student work/results needs -->
|
|
11259
|
+
<!-- to be associated with the parent/enclosing "exercise" -->
|
|
11260
|
+
<!-- (or PROJECT-LIKE). So in this case (only) we place -->
|
|
11261
|
+
<!-- an id value on the div.exercise-wrapper that is -->
|
|
11262
|
+
<!-- derived from the parent. Otherwise, we use the -->
|
|
11263
|
+
<!-- @assembly-id of this "webwork-reps" with a "-ww-inner" -->
|
|
11264
|
+
<!-- suffix. That attribute is NOT the assembly stamp and -->
|
|
11265
|
+
<!-- carries no "pi" prefix: it is written by webwork.py into -->
|
|
11266
|
+
<!-- the generated representation file, naming it for the -->
|
|
11267
|
+
<!-- exercise it belongs to. The suffix ensures the inner -->
|
|
11268
|
+
<!-- wrapper's DOM id is distinct from the enclosing -->
|
|
11269
|
+
<!-- "exercise" article's id, which holds the same value. -->
|
|
11270
|
+
<!-- Without the suffix, JavaScript (handleWW) would -->
|
|
11271
|
+
<!-- look up the inner id with getElementById and find -->
|
|
11272
|
+
<!-- the outer "exercise" article instead. -->
|
|
11172
11273
|
<xsl:variable name="inner-id">
|
|
11173
11274
|
<xsl:choose>
|
|
11174
11275
|
<xsl:when test="$b-host-runestone">
|
|
@@ -11176,7 +11277,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
11176
11277
|
<xsl:text>-ww-rs</xsl:text>
|
|
11177
11278
|
</xsl:when>
|
|
11178
11279
|
<xsl:otherwise>
|
|
11179
|
-
<xsl:value-of select="concat(@
|
|
11280
|
+
<xsl:value-of select="concat(@assembly-id, '-ww-inner')"/>
|
|
11180
11281
|
</xsl:otherwise>
|
|
11181
11282
|
</xsl:choose>
|
|
11182
11283
|
</xsl:variable>
|
|
@@ -11324,7 +11425,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
11324
11425
|
</xsl:variable>
|
|
11325
11426
|
<!-- build the iframe -->
|
|
11326
11427
|
<!-- mimicking Mike Gage's blog post -->
|
|
11327
|
-
<iframe name="{concat(@
|
|
11428
|
+
<iframe name="{concat(@assembly-id, '-ww-inner')}" width="{$design-width}" src="{$the-url}" data-seed="{static/@seed}"/>
|
|
11328
11429
|
<script>
|
|
11329
11430
|
<xsl:text>iFrameResize({log:true,inPageLinks:true,resizeFrom:'child',checkOrigin:["</xsl:text>
|
|
11330
11431
|
<xsl:value-of select="$webwork-server" />
|
|
@@ -12587,6 +12688,116 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
12587
12688
|
</dialog>
|
|
12588
12689
|
</xsl:template>
|
|
12589
12690
|
|
|
12691
|
+
<!-- Read-aloud (embedded text-to-speech): a toolbar button, a minimal -->
|
|
12692
|
+
<!-- expanding player (prev, play/pause, next, continue, settings), and the -->
|
|
12693
|
+
<!-- settings dialog that button opens. -->
|
|
12694
|
+
<!-- -->
|
|
12695
|
+
<!-- The words below are literal English rather than localization -->
|
|
12696
|
+
<!-- string-ids. xsl/localizations is for content that reaches more than -->
|
|
12697
|
+
<!-- one output format, and this is an HTML-only control surface. Nothing -->
|
|
12698
|
+
<!-- here has a LaTeX or EPUB counterpart. The strings the player *speaks* -->
|
|
12699
|
+
<!-- live in js/src/read-aloud/strings.js for the same reason; a -->
|
|
12700
|
+
<!-- JavaScript-side translation layer will eventually address both halves. -->
|
|
12701
|
+
<xsl:template name="read-aloud-controls">
|
|
12702
|
+
<button id="ptx-read-aloud-button" class="ptx-read-aloud-button button" title="Read aloud" aria-expanded="false">
|
|
12703
|
+
<xsl:call-template name="insert-symbol">
|
|
12704
|
+
<xsl:with-param name="name" select="'text_to_speech'"/>
|
|
12705
|
+
</xsl:call-template>
|
|
12706
|
+
<span class="name">Read aloud</span>
|
|
12707
|
+
</button>
|
|
12708
|
+
<!-- player-ui.js retitles the toolbar and play/pause buttons as their -->
|
|
12709
|
+
<!-- states change; the titles here are the pre-JavaScript defaults. -->
|
|
12710
|
+
<div id="ptx-read-aloud-player" class="ptx-read-aloud-player" hidden="hidden" role="group" aria-label="Read aloud">
|
|
12711
|
+
<button id="ptx-read-aloud-prev" class="button" title="Previous sentence">
|
|
12712
|
+
<xsl:call-template name="insert-symbol">
|
|
12713
|
+
<xsl:with-param name="name" select="'skip_previous'"/>
|
|
12714
|
+
</xsl:call-template>
|
|
12715
|
+
</button>
|
|
12716
|
+
<button id="ptx-read-aloud-toggle" class="ptx-read-aloud-toggle button" title="Play">
|
|
12717
|
+
<span class="ptx-read-aloud-icon-play">
|
|
12718
|
+
<xsl:call-template name="insert-symbol">
|
|
12719
|
+
<xsl:with-param name="name" select="'play_arrow'"/>
|
|
12720
|
+
</xsl:call-template>
|
|
12721
|
+
</span>
|
|
12722
|
+
<span class="ptx-read-aloud-icon-pause">
|
|
12723
|
+
<xsl:call-template name="insert-symbol">
|
|
12724
|
+
<xsl:with-param name="name" select="'pause'"/>
|
|
12725
|
+
</xsl:call-template>
|
|
12726
|
+
</span>
|
|
12727
|
+
</button>
|
|
12728
|
+
<button id="ptx-read-aloud-next" class="button" title="Next sentence">
|
|
12729
|
+
<xsl:call-template name="insert-symbol">
|
|
12730
|
+
<xsl:with-param name="name" select="'skip_next'"/>
|
|
12731
|
+
</xsl:call-template>
|
|
12732
|
+
</button>
|
|
12733
|
+
<a id="ptx-read-aloud-continue" class="ptx-read-aloud-continue button" hidden="hidden">
|
|
12734
|
+
<xsl:text>Continue</xsl:text>
|
|
12735
|
+
<xsl:call-template name="insert-symbol">
|
|
12736
|
+
<xsl:with-param name="name" select="'play_arrow'"/>
|
|
12737
|
+
</xsl:call-template>
|
|
12738
|
+
</a>
|
|
12739
|
+
<button id="ptx-read-aloud-settings-button" class="ptx-read-aloud-settings-button button" title="Reading settings">
|
|
12740
|
+
<xsl:call-template name="insert-symbol">
|
|
12741
|
+
<xsl:with-param name="name" select="'tune'"/>
|
|
12742
|
+
</xsl:call-template>
|
|
12743
|
+
</button>
|
|
12744
|
+
<!-- No close button: the toolbar button that opened the player is -->
|
|
12745
|
+
<!-- a disclosure toggle and collapses it again, so a second -->
|
|
12746
|
+
<!-- dismissal control would only cost space in the navbar row. -->
|
|
12747
|
+
</div>
|
|
12748
|
+
<!-- Read-aloud settings, opened from the player's own settings button. -->
|
|
12749
|
+
<!-- Deliberately a sibling of the player rather than a child: the player -->
|
|
12750
|
+
<!-- is a flex row, and a dialog inside it would be a flex item. -->
|
|
12751
|
+
<dialog class="ptx-dialog ptx-read-aloud-settings-popup" id="ptx-read-aloud-settings-popup">
|
|
12752
|
+
<div class="ptx-readability-options-popup-controls">
|
|
12753
|
+
<h2 class="heading">Read aloud settings</h2>
|
|
12754
|
+
<button class="ptx-read-aloud-settings-close-button button" id="ptx-read-aloud-settings-close-button" title="Close">
|
|
12755
|
+
<xsl:call-template name="insert-symbol">
|
|
12756
|
+
<xsl:with-param name="name" select="'close'"/>
|
|
12757
|
+
</xsl:call-template>
|
|
12758
|
+
</button>
|
|
12759
|
+
</div>
|
|
12760
|
+
<div class="ptx-readability-options-group">
|
|
12761
|
+
<label for="ptx-read-aloud-voice">
|
|
12762
|
+
<xsl:call-template name="insert-symbol">
|
|
12763
|
+
<xsl:with-param name="name" select="'record_voice_over'"/>
|
|
12764
|
+
</xsl:call-template>
|
|
12765
|
+
<span>Voice</span>
|
|
12766
|
+
</label>
|
|
12767
|
+
<!-- options populated by settings.js from speechSynthesis.getVoices() -->
|
|
12768
|
+
<select id="ptx-read-aloud-voice"></select>
|
|
12769
|
+
<label class="ptx-readability-slider-label" for="ptx-read-aloud-rate">
|
|
12770
|
+
<xsl:call-template name="insert-symbol">
|
|
12771
|
+
<xsl:with-param name="name" select="'speed'"/>
|
|
12772
|
+
</xsl:call-template>
|
|
12773
|
+
<span>Reading speed</span>
|
|
12774
|
+
<output id="ptx-read-aloud-rate-value" for="ptx-read-aloud-rate">1×</output>
|
|
12775
|
+
</label>
|
|
12776
|
+
<input type="range" id="ptx-read-aloud-rate" min="0.5" max="2" step="0.1" value="1"/>
|
|
12777
|
+
<label for="ptx-read-aloud-asides">
|
|
12778
|
+
<xsl:call-template name="insert-symbol">
|
|
12779
|
+
<xsl:with-param name="name" select="'unfold_more'"/>
|
|
12780
|
+
</xsl:call-template>
|
|
12781
|
+
<span>Collapsed content</span>
|
|
12782
|
+
</label>
|
|
12783
|
+
<!-- What happens to a knowl's body once its title is read. -->
|
|
12784
|
+
<select id="ptx-read-aloud-asides">
|
|
12785
|
+
<option value="skip">Announce, do not read</option>
|
|
12786
|
+
<option value="read">Read automatically</option>
|
|
12787
|
+
</select>
|
|
12788
|
+
<label for="ptx-read-aloud-autoscroll">
|
|
12789
|
+
<input type="checkbox" id="ptx-read-aloud-autoscroll" checked="checked"/>
|
|
12790
|
+
<span>Follow along (auto-scroll)</span>
|
|
12791
|
+
</label>
|
|
12792
|
+
<!-- Unchecked by default: this one navigates, so it is opt-in. -->
|
|
12793
|
+
<label for="ptx-read-aloud-autocontinue">
|
|
12794
|
+
<input type="checkbox" id="ptx-read-aloud-autocontinue"/>
|
|
12795
|
+
<span>Continue to the next page automatically</span>
|
|
12796
|
+
</label>
|
|
12797
|
+
</div>
|
|
12798
|
+
</dialog>
|
|
12799
|
+
</xsl:template>
|
|
12800
|
+
|
|
12590
12801
|
<xsl:template name="embed-button">
|
|
12591
12802
|
<xsl:variable name="embed-localization">
|
|
12592
12803
|
<xsl:apply-templates select="." mode="type-name">
|
|
@@ -12862,6 +13073,10 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
12862
13073
|
<xsl:if test="$b-has-embed-button">
|
|
12863
13074
|
<xsl:call-template name="embed-button" />
|
|
12864
13075
|
</xsl:if>
|
|
13076
|
+
<!-- Read-aloud button and expanding player -->
|
|
13077
|
+
<xsl:if test="$b-read-aloud">
|
|
13078
|
+
<xsl:call-template name="read-aloud-controls" />
|
|
13079
|
+
</xsl:if>
|
|
12865
13080
|
<xsl:call-template name="readability-options" />
|
|
12866
13081
|
</span>
|
|
12867
13082
|
</xsl:template>
|
|
@@ -13070,6 +13285,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
13070
13285
|
<xsl:if test="not($the-number = '')">
|
|
13071
13286
|
<span class="codenumber">
|
|
13072
13287
|
<xsl:value-of select="$the-number" />
|
|
13288
|
+
<xsl:apply-templates select="." mode="division-number-separator"/>
|
|
13073
13289
|
</span>
|
|
13074
13290
|
<!-- separating space, only if needed -->
|
|
13075
13291
|
<xsl:text> </xsl:text>
|
|
@@ -13748,6 +13964,8 @@ TODO:
|
|
|
13748
13964
|
<xsl:text>hasSage: </xsl:text><xsl:value-of select="$b-has-sage"/><xsl:text>,
</xsl:text>
|
|
13749
13965
|
<xsl:text>isReact: </xsl:text><xsl:value-of select="$b-debug-react"/><xsl:text>,
</xsl:text>
|
|
13750
13966
|
<xsl:text>htmlPresentation: </xsl:text><xsl:value-of select="$b-html-presentation"/><xsl:text>,
</xsl:text>
|
|
13967
|
+
<!-- Added to support read-aloud functionality; shouldn't hurt anything else -->
|
|
13968
|
+
<xsl:text>lang: "</xsl:text><xsl:value-of select="$document-language"/><xsl:text>",
</xsl:text>
|
|
13751
13969
|
<xsl:text>});
</xsl:text>
|
|
13752
13970
|
</script>
|
|
13753
13971
|
<!-- MathJax 4 CDN -->
|
|
@@ -14119,6 +14337,9 @@ TODO:
|
|
|
14119
14337
|
<xsl:if test="$b-has-program and not($b-debug-react)">
|
|
14120
14338
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.26.0/components/prism-core.min.js"></script>
|
|
14121
14339
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.26.0/plugins/autoloader/prism-autoloader.min.js"></script>
|
|
14340
|
+
<xsl:if test="$b-has-gdscript">
|
|
14341
|
+
<script src="{$html.js.dir}/prism/gdscript-prism.js"></script>
|
|
14342
|
+
</xsl:if>
|
|
14122
14343
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.26.0/plugins/line-numbers/prism-line-numbers.min.js" integrity="sha512-dubtf8xMHSQlExGRQ5R7toxHLgSDZ0K7AunqPWHXmJQ8XyVIG19S1T95gBxlAeGOK02P4Da2RTnQz0Za0H0ebQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
14123
14344
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.26.0/plugins/line-highlight/prism-line-highlight.min.js" integrity="sha512-93uCmm0q+qO5Lb1huDqr7tywS8A2TFA+1/WHvyiWaK6/pvsFl6USnILagntBx8JnVbQH5s3n0vQZY6xNthNfKA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
14124
14345
|
<xsl:if test="$b-html-theme-legacy or $b-reveal-build" >
|
|
@@ -14319,6 +14540,11 @@ TODO:
|
|
|
14319
14540
|
?v= query string busts the browser cache when the CLI version changes,
|
|
14320
14541
|
restoring the cache-busting that pretext_add_on.js?x=1 previously provided. -->
|
|
14321
14542
|
<script src="{$html.js.dir}/pretext-core.js?v={$cli.version}"></script>
|
|
14543
|
+
<!-- Read-aloud bundle: only when the publication option is on,
|
|
14544
|
+
so an opted-out build ships zero text-to-speech bytes. -->
|
|
14545
|
+
<xsl:if test="$b-read-aloud">
|
|
14546
|
+
<script src="{$html.js.dir}/pretext-read-aloud.js?v={$cli.version}"></script>
|
|
14547
|
+
</xsl:if>
|
|
14322
14548
|
</xsl:when>
|
|
14323
14549
|
<xsl:when test="$b-debug-react-local">
|
|
14324
14550
|
<script type="module" defer="" src="./static/js/main.js"></script>
|
|
@@ -14717,7 +14943,24 @@ TODO:
|
|
|
14717
14943
|
<!-- We put page-margins-attributes only on printout sections -->
|
|
14718
14944
|
<xsl:template match="*" mode="page-margins-attribute"/>
|
|
14719
14945
|
|
|
14946
|
+
<!-- A PROJECT-LIKE acting as a standalone printout is paginated by the -->
|
|
14947
|
+
<!-- same javascript, so it needs the same data. It has no margin -->
|
|
14948
|
+
<!-- attributes of its own, so "printout-margin" falls through to the -->
|
|
14949
|
+
<!-- publisher's worksheet defaults for all four sides. -->
|
|
14950
|
+
<xsl:template match="&PROJECT-LIKE;" mode="page-margins-attribute">
|
|
14951
|
+
<xsl:variable name="b-standalone-printout">
|
|
14952
|
+
<xsl:apply-templates select="." mode="is-standalone-printout"/>
|
|
14953
|
+
</xsl:variable>
|
|
14954
|
+
<xsl:if test="$b-standalone-printout = 'true'">
|
|
14955
|
+
<xsl:call-template name="printout-margins-attribute"/>
|
|
14956
|
+
</xsl:if>
|
|
14957
|
+
</xsl:template>
|
|
14958
|
+
|
|
14720
14959
|
<xsl:template match="&PRINTOUT;" mode="page-margins-attribute">
|
|
14960
|
+
<xsl:call-template name="printout-margins-attribute"/>
|
|
14961
|
+
</xsl:template>
|
|
14962
|
+
|
|
14963
|
+
<xsl:template name="printout-margins-attribute">
|
|
14721
14964
|
<xsl:attribute name="data-margins">
|
|
14722
14965
|
<!-- A space-separated list for top, right, bottom, and left margins -->
|
|
14723
14966
|
<xsl:apply-templates select="." mode="printout-margin">
|
|
@@ -14745,7 +14988,20 @@ TODO:
|
|
|
14745
14988
|
<!-- Add data-* attributes for headers and footers -->
|
|
14746
14989
|
<xsl:template match="*" mode="page-header-footer-attributes"/>
|
|
14747
14990
|
|
|
14991
|
+
<xsl:template match="&PROJECT-LIKE;" mode="page-header-footer-attributes">
|
|
14992
|
+
<xsl:variable name="b-standalone-printout">
|
|
14993
|
+
<xsl:apply-templates select="." mode="is-standalone-printout"/>
|
|
14994
|
+
</xsl:variable>
|
|
14995
|
+
<xsl:if test="$b-standalone-printout = 'true'">
|
|
14996
|
+
<xsl:call-template name="printout-header-footer-attributes"/>
|
|
14997
|
+
</xsl:if>
|
|
14998
|
+
</xsl:template>
|
|
14999
|
+
|
|
14748
15000
|
<xsl:template match="&PRINTOUT;" mode="page-header-footer-attributes">
|
|
15001
|
+
<xsl:call-template name="printout-header-footer-attributes"/>
|
|
15002
|
+
</xsl:template>
|
|
15003
|
+
|
|
15004
|
+
<xsl:template name="printout-header-footer-attributes">
|
|
14749
15005
|
<xsl:if test="not($ws-header-first-left = '')">
|
|
14750
15006
|
<xsl:attribute name="data-header-first-left">
|
|
14751
15007
|
<xsl:value-of select="normalize-space($ws-header-first-left)"/>
|