@pretextbook/pretext-html 0.4.0 → 0.6.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 +92 -1
- package/assets/preview-html.xsl +14 -0
- package/assets/preview-revealjs.xsl +85 -0
- package/assets/upstream.json +1 -1
- package/assets/xsl/LICENSE-pretext +16 -0
- package/assets/xsl/entities.ent +7 -0
- package/assets/xsl/extract-biblio-csl.xsl +5 -3
- package/assets/xsl/extract-dynamic.xsl +14 -12
- package/assets/xsl/extract-interactive.xsl +2 -2
- package/assets/xsl/extract-pg.xsl +12 -9
- package/assets/xsl/extract-qrcode.xsl +1 -1
- package/assets/xsl/extract-trace.xsl +3 -3
- package/assets/xsl/extract-youtube.xsl +1 -1
- package/assets/xsl/latex/pretext-latex-texstyle.xsl +3 -3
- package/assets/xsl/pretext-assembly.xsl +362 -357
- package/assets/xsl/pretext-braille-preprint.xsl +1 -1
- package/assets/xsl/pretext-common.xsl +101 -90
- package/assets/xsl/pretext-epub.xsl +17 -6
- package/assets/xsl/pretext-fo.xsl +10 -10
- package/assets/xsl/pretext-html.xsl +83 -60
- package/assets/xsl/pretext-latex-common.xsl +8 -8
- package/assets/xsl/pretext-numbers.xsl +35 -35
- package/assets/xsl/pretext-revealjs.xsl +1 -1
- package/assets/xsl/pretext-runestone-fitb.xsl +14 -13
- package/assets/xsl/pretext-runestone-static.xsl +17 -17
- package/assets/xsl/pretext-runestone.xsl +33 -31
- package/assets/xsl/pretext-view-source.xsl +5 -3
- package/assets/xsl/pretext-ww-problem-sets.xsl +6 -1
- package/assets/xsl/publisher-variables.xsl +23 -47
- package/assets/xsl-bundle.json +1 -1
- package/dist/cli-DF7XOWN7.js +724 -0
- package/dist/cli.js +1 -1
- package/dist/index.browser.d.ts +6 -0
- package/dist/index.browser.js +501 -332
- package/dist/index.d.ts +6 -0
- package/dist/index.js +25 -19
- package/dist/knowls.d.ts +43 -0
- package/dist/publication.d.ts +25 -19
- package/dist/renderer.d.ts +61 -0
- package/dist/reveal.d.ts +77 -0
- package/dist/reveal.js +110 -0
- package/dist/target.d.ts +34 -0
- package/package.json +12 -1
- package/dist/cli-Cp6C0sif.js +0 -654
|
@@ -1009,7 +1009,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
1009
1009
|
<xsl:apply-templates select="." mode="title-full" />
|
|
1010
1010
|
</span>
|
|
1011
1011
|
<!-- add print preview button for printouts -->
|
|
1012
|
-
<xsl:if test="(
|
|
1012
|
+
<xsl:if test="(&PRINTOUT-FILTER;)">
|
|
1013
1013
|
<xsl:apply-templates select="." mode="standalone-printout-links"/>
|
|
1014
1014
|
</xsl:if>
|
|
1015
1015
|
</xsl:template>
|
|
@@ -1019,7 +1019,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
1019
1019
|
<!-- print previews. A simple button with printer icon that reloads -->
|
|
1020
1020
|
<!-- the page with a url parameter that tells javascript to switch -->
|
|
1021
1021
|
<!-- to printout css and format all the pages and workspace. -->
|
|
1022
|
-
<xsl:template match="
|
|
1022
|
+
<xsl:template match="&PRINTOUT;" mode="standalone-printout-links">
|
|
1023
1023
|
<xsl:variable name="printout-id">
|
|
1024
1024
|
<xsl:apply-templates select="." mode="html-id"/>
|
|
1025
1025
|
</xsl:variable>
|
|
@@ -1946,7 +1946,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
1946
1946
|
</xsl:template>
|
|
1947
1947
|
|
|
1948
1948
|
<!-- The directories of knowls that are targets of references. Most, -->
|
|
1949
|
-
<!-- but not all, filenames are based on the "
|
|
1949
|
+
<!-- but not all, filenames are based on the "unique-id" template, -->
|
|
1950
1950
|
<!-- but this is organized so alternate naming conventions can be used. -->
|
|
1951
1951
|
<!-- The file extension is *.html so recognized as OK by Moodle, etc -->
|
|
1952
1952
|
<xsl:template match="*" mode="knowl-filename">
|
|
@@ -1963,15 +1963,15 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
1963
1963
|
</xsl:when>
|
|
1964
1964
|
<xsl:when test="$origin = 'index'">
|
|
1965
1965
|
<xsl:text>index/</xsl:text>
|
|
1966
|
-
<xsl:apply-templates select="." mode="
|
|
1966
|
+
<xsl:apply-templates select="." mode="unique-id" />
|
|
1967
1967
|
</xsl:when>
|
|
1968
1968
|
<xsl:when test="$origin = 'list-of'">
|
|
1969
1969
|
<xsl:text>list-of/</xsl:text>
|
|
1970
|
-
<xsl:apply-templates select="." mode="
|
|
1970
|
+
<xsl:apply-templates select="." mode="unique-id" />
|
|
1971
1971
|
</xsl:when>
|
|
1972
1972
|
<xsl:when test="$origin = 'notation'">
|
|
1973
1973
|
<xsl:text>notation/</xsl:text>
|
|
1974
|
-
<xsl:apply-templates select="." mode="
|
|
1974
|
+
<xsl:apply-templates select="." mode="unique-id" />
|
|
1975
1975
|
</xsl:when>
|
|
1976
1976
|
<!-- put a "location-report" template here to debug a bad knowl file -->
|
|
1977
1977
|
<!-- (the file, or a reference to it) that lacks a subdirectory -->
|
|
@@ -3953,9 +3953,9 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
3953
3953
|
<!-- * Never for a "worksheet" - too messy for printing -->
|
|
3954
3954
|
<!-- * Not hitting PROJECT-LIKE here, see elsewhere -->
|
|
3955
3955
|
<xsl:variable name="b-tabbed-tasks" select="
|
|
3956
|
-
(@exercise-customization = 'divisional' and $b-html-tabbed-tasks-divisional) or
|
|
3957
|
-
(@exercise-customization = 'inline' and $b-html-tabbed-tasks-inline) or
|
|
3958
|
-
(@exercise-customization = 'reading' and $b-html-tabbed-tasks-reading)"/>
|
|
3956
|
+
(@pi:exercise-customization = 'divisional' and $b-html-tabbed-tasks-divisional) or
|
|
3957
|
+
(@pi:exercise-customization = 'inline' and $b-html-tabbed-tasks-inline) or
|
|
3958
|
+
(@pi:exercise-customization = 'reading' and $b-html-tabbed-tasks-reading)"/>
|
|
3959
3959
|
<xsl:choose>
|
|
3960
3960
|
<xsl:when test="$b-tabbed-tasks">
|
|
3961
3961
|
<!-- Use tabbed viewer from Runestone Components -->
|
|
@@ -4099,7 +4099,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
4099
4099
|
<!-- be presented by a "tabbed" interface from Runestone -->
|
|
4100
4100
|
<!-- components. Note: this test is simpler than for -->
|
|
4101
4101
|
<!-- "exercise" since we know we have a PROJECT-LIKE and -->
|
|
4102
|
-
<!-- do not need to consult @exercise-customization.
|
|
4102
|
+
<!-- do not need to consult @pi:exercise-customization. -->
|
|
4103
4103
|
<xsl:choose>
|
|
4104
4104
|
<xsl:when test="$b-html-tabbed-tasks-project">
|
|
4105
4105
|
<!-- Use tabbed viewer from Runestone Components -->
|
|
@@ -4553,7 +4553,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
4553
4553
|
<!-- Largely a Runestone/database operation referencing -->
|
|
4554
4554
|
<!-- existing questions supplied by the manifest, -->
|
|
4555
4555
|
<!-- so we go straight to an HTML version -->
|
|
4556
|
-
<xsl:template match="*[@exercise-interactive = 'select']" mode="exercise-components">
|
|
4556
|
+
<xsl:template match="*[@pi:exercise-interactive = 'select']" mode="exercise-components">
|
|
4557
4557
|
<xsl:apply-templates select="." mode="runestone-to-interactive"/>
|
|
4558
4558
|
</xsl:template>
|
|
4559
4559
|
|
|
@@ -4569,17 +4569,17 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
4569
4569
|
<!-- The "runestone-to-interactive" templates will combine a -->
|
|
4570
4570
|
<!-- "regular" PreTeXt statement together with some additional -->
|
|
4571
4571
|
<!-- interactive material to make a hybrid "statement" -->
|
|
4572
|
-
<xsl:template match="*[(@exercise-interactive = 'truefalse') or
|
|
4573
|
-
(@exercise-interactive = 'multiplechoice') or
|
|
4574
|
-
(@exercise-interactive = 'parson') or
|
|
4575
|
-
(@exercise-interactive = 'parson-horizontal') or
|
|
4576
|
-
(@exercise-interactive = 'cardsort') or
|
|
4577
|
-
(@exercise-interactive = 'matching') or
|
|
4578
|
-
(@exercise-interactive = 'clickablearea') or
|
|
4579
|
-
(@exercise-interactive = 'fillin-basic') or
|
|
4580
|
-
(@exercise-interactive = 'coding') or
|
|
4581
|
-
(@exercise-interactive = 'dual') or
|
|
4582
|
-
(@exercise-interactive = 'shortanswer')]" mode="exercise-components">
|
|
4572
|
+
<xsl:template match="*[(@pi:exercise-interactive = 'truefalse') or
|
|
4573
|
+
(@pi:exercise-interactive = 'multiplechoice') or
|
|
4574
|
+
(@pi:exercise-interactive = 'parson') or
|
|
4575
|
+
(@pi:exercise-interactive = 'parson-horizontal') or
|
|
4576
|
+
(@pi:exercise-interactive = 'cardsort') or
|
|
4577
|
+
(@pi:exercise-interactive = 'matching') or
|
|
4578
|
+
(@pi:exercise-interactive = 'clickablearea') or
|
|
4579
|
+
(@pi:exercise-interactive = 'fillin-basic') or
|
|
4580
|
+
(@pi:exercise-interactive = 'coding') or
|
|
4581
|
+
(@pi:exercise-interactive = 'dual') or
|
|
4582
|
+
(@pi:exercise-interactive = 'shortanswer')]" mode="exercise-components">
|
|
4583
4583
|
<xsl:param name="b-original"/>
|
|
4584
4584
|
<xsl:param name="block-type"/>
|
|
4585
4585
|
<xsl:param name="heading-level"/>
|
|
@@ -4603,7 +4603,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
4603
4603
|
|
|
4604
4604
|
<!-- Dynamic fillin is broken out separately because the test for -->
|
|
4605
4605
|
<!-- correctness as well as feedback is dynamically chosen. -->
|
|
4606
|
-
<xsl:template match="*[@exercise-interactive = 'fillin']" mode="exercise-components">
|
|
4606
|
+
<xsl:template match="*[@pi:exercise-interactive = 'fillin']" mode="exercise-components">
|
|
4607
4607
|
<xsl:param name="b-original"/>
|
|
4608
4608
|
<xsl:param name="block-type"/>
|
|
4609
4609
|
<xsl:param name="heading-level"/>
|
|
@@ -6088,7 +6088,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
6088
6088
|
<!-- Utility templates to translate PTX -->
|
|
6089
6089
|
<!-- enumeration style to HTML list-style-type -->
|
|
6090
6090
|
<xsl:template match="ol|ol-marker" mode="html-list-class">
|
|
6091
|
-
<xsl:variable name="mbx-format-code" select="./@format-code" />
|
|
6091
|
+
<xsl:variable name="mbx-format-code" select="./@pi:format-code" />
|
|
6092
6092
|
<xsl:choose>
|
|
6093
6093
|
<xsl:when test="$mbx-format-code = '0'">decimal</xsl:when>
|
|
6094
6094
|
<xsl:when test="$mbx-format-code = '1'">decimal</xsl:when>
|
|
@@ -6129,7 +6129,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
6129
6129
|
<xsl:variable name="mbx-format-code">
|
|
6130
6130
|
<xsl:choose>
|
|
6131
6131
|
<xsl:when test="self::ol">
|
|
6132
|
-
<xsl:value-of select="./@format-code" />
|
|
6132
|
+
<xsl:value-of select="./@pi:format-code" />
|
|
6133
6133
|
</xsl:when>
|
|
6134
6134
|
<xsl:otherwise>
|
|
6135
6135
|
<xsl:apply-templates select="." mode="format-code" />
|
|
@@ -6181,7 +6181,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
6181
6181
|
</xsl:for-each >
|
|
6182
6182
|
</xsl:template>
|
|
6183
6183
|
|
|
6184
|
-
<xsl:template match="ol[not(@marker) and @format-code = 'a' and @ordered-list-level = '1']" mode="ol-marker-class">
|
|
6184
|
+
<xsl:template match="ol[not(@marker) and @pi:format-code = 'a' and @pi:ordered-list-level = '1']" mode="ol-marker-class">
|
|
6185
6185
|
<xsl:text>lower-alpha-level-1</xsl:text>
|
|
6186
6186
|
</xsl:template>
|
|
6187
6187
|
|
|
@@ -6189,10 +6189,10 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
6189
6189
|
|
|
6190
6190
|
<xsl:template match="ol[@marker]" mode="ol-markers">
|
|
6191
6191
|
<xsl:element name="ol-marker">
|
|
6192
|
-
<xsl:copy-of select="@format-code"/>
|
|
6192
|
+
<xsl:copy-of select="@pi:format-code"/>
|
|
6193
6193
|
<xsl:copy-of select="@marker"/>
|
|
6194
|
-
<xsl:copy-of select="@marker-prefix"/>
|
|
6195
|
-
<xsl:copy-of select="@marker-suffix"/>
|
|
6194
|
+
<xsl:copy-of select="@pi:marker-prefix"/>
|
|
6195
|
+
<xsl:copy-of select="@pi:marker-suffix"/>
|
|
6196
6196
|
<xsl:attribute name="classname">
|
|
6197
6197
|
<xsl:text>ol-marker-</xsl:text>
|
|
6198
6198
|
<xsl:value-of select="position()" />
|
|
@@ -6206,11 +6206,11 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
6206
6206
|
<xsl:text>ol.</xsl:text>
|
|
6207
6207
|
<xsl:value-of select="./@classname"/>
|
|
6208
6208
|
<xsl:text> > li::marker { content: "</xsl:text>
|
|
6209
|
-
<xsl:value-of select="./@marker-prefix" />
|
|
6209
|
+
<xsl:value-of select="./@pi:marker-prefix" />
|
|
6210
6210
|
<xsl:text>"counter(list-item,</xsl:text>
|
|
6211
6211
|
<xsl:apply-templates select="." mode="html-list-class" />
|
|
6212
6212
|
<xsl:text>)"</xsl:text>
|
|
6213
|
-
<xsl:value-of select="./@marker-suffix" />
|
|
6213
|
+
<xsl:value-of select="./@pi:marker-suffix" />
|
|
6214
6214
|
<xsl:text> "; }
</xsl:text>
|
|
6215
6215
|
</xsl:template>
|
|
6216
6216
|
|
|
@@ -6748,7 +6748,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
6748
6748
|
<xsl:when test="latex-image">
|
|
6749
6749
|
<xsl:apply-templates select="$image-svg-xml/svg:svg/*" mode="svg-unique-ids">
|
|
6750
6750
|
<xsl:with-param name="svg-unique-id">
|
|
6751
|
-
<xsl:value-of select="@unique-id"/>
|
|
6751
|
+
<xsl:value-of select="@pi:unique-id"/>
|
|
6752
6752
|
</xsl:with-param>
|
|
6753
6753
|
</xsl:apply-templates>
|
|
6754
6754
|
</xsl:when>
|
|
@@ -6803,7 +6803,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
6803
6803
|
|
|
6804
6804
|
<!-- Utility template so "aria-describedby" values are consistent -->
|
|
6805
6805
|
<xsl:template match="image|interactive[@platform|@desmos|@calcplot3d|@circuitjs|@iframe]" mode="describedby-id">
|
|
6806
|
-
<xsl:apply-templates select="." mode="
|
|
6806
|
+
<xsl:apply-templates select="." mode="unique-id"/>
|
|
6807
6807
|
<xsl:text>-description</xsl:text>
|
|
6808
6808
|
</xsl:template>
|
|
6809
6809
|
|
|
@@ -8590,9 +8590,9 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
8590
8590
|
</xsl:template>
|
|
8591
8591
|
|
|
8592
8592
|
<!-- The @id attribute of an HTML element is critical. -->
|
|
8593
|
-
<!-- We supply the "
|
|
8593
|
+
<!-- We supply the "unique-id". -->
|
|
8594
8594
|
<xsl:template match="*" mode="html-id">
|
|
8595
|
-
<xsl:apply-templates select="." mode="
|
|
8595
|
+
<xsl:apply-templates select="." mode="unique-id"/>
|
|
8596
8596
|
</xsl:template>
|
|
8597
8597
|
|
|
8598
8598
|
<!-- And a convenience template to make an id attribute. -->
|
|
@@ -8613,9 +8613,9 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
8613
8613
|
<!-- is banned in Javascript, so we make a "no-dash" version, -->
|
|
8614
8614
|
<!-- by replacing a hyphen by a double-underscore. -->
|
|
8615
8615
|
<!-- NB: This runs some non-zero probability of breaking uniqueness -->
|
|
8616
|
-
<xsl:template match="*" mode="
|
|
8616
|
+
<xsl:template match="*" mode="unique-id-no-dash">
|
|
8617
8617
|
<xsl:variable name="the-id">
|
|
8618
|
-
<xsl:apply-templates select="." mode="
|
|
8618
|
+
<xsl:apply-templates select="." mode="unique-id" />
|
|
8619
8619
|
</xsl:variable>
|
|
8620
8620
|
<xsl:value-of select="str:replace($the-id, '-', '__')" />
|
|
8621
8621
|
</xsl:template>
|
|
@@ -8885,7 +8885,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
8885
8885
|
<!-- https://groups.google.com/forum/#!topic/mathjax-users/IEivs1D7ntM -->
|
|
8886
8886
|
<xsl:template match="fillin[not(parent::m or parent::mrow)]">
|
|
8887
8887
|
<xsl:choose>
|
|
8888
|
-
<xsl:when test="ancestor::statement/../@exercise-interactive='fillin'">
|
|
8888
|
+
<xsl:when test="ancestor::statement/../@pi:exercise-interactive='fillin'">
|
|
8889
8889
|
<xsl:apply-imports />
|
|
8890
8890
|
</xsl:when>
|
|
8891
8891
|
<xsl:otherwise>
|
|
@@ -9874,7 +9874,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
9874
9874
|
<!-- We want to recognize an "interactive" authored -->
|
|
9875
9875
|
<!-- in an "exercise" (or similar) which originated -->
|
|
9876
9876
|
<!-- from a "dual" dynamic/static exercise. -->
|
|
9877
|
-
<xsl:variable name="b-in-dual-exercise" select="ancestor::*[@exercise-interactive = 'dual']"/>
|
|
9877
|
+
<xsl:variable name="b-in-dual-exercise" select="ancestor::*[@pi:exercise-interactive = 'dual']"/>
|
|
9878
9878
|
<xsl:choose>
|
|
9879
9879
|
<!-- A DoenetML interactive lives two lives. Plain 'ol PreTeXt, -->
|
|
9880
9880
|
<!-- supported by a Doenet CDN for its interactivity. But when -->
|
|
@@ -10329,11 +10329,32 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
10329
10329
|
</canvas>
|
|
10330
10330
|
</xsl:template>
|
|
10331
10331
|
|
|
10332
|
-
<!-- HTML Code
|
|
10333
|
-
<!-- Simply create deep-copy of HTML elements
|
|
10334
|
-
<!-- TODO: should this be a div, with width and height?
|
|
10332
|
+
<!-- HTML Code -->
|
|
10333
|
+
<!-- Simply create deep-copy of HTML elements -->
|
|
10334
|
+
<!-- TODO: should this be a div, with width and height? -->
|
|
10335
|
+
<!-- Authored HTML goes into the page verbatim. But a plain -->
|
|
10336
|
+
<!-- "xsl:copy-of" materializes every namespace in scope at the -->
|
|
10337
|
+
<!-- source location as a declaration on the copy: the source -->
|
|
10338
|
+
<!-- file's own declarations (such as XInclude) and any -->
|
|
10339
|
+
<!-- namespace employed by the assembly machinery. So instead -->
|
|
10340
|
+
<!-- we rebuild each element, which carries along only the -->
|
|
10341
|
+
<!-- namespaces actually in use. -->
|
|
10335
10342
|
<xsl:template match="slate[@surface = 'html']">
|
|
10336
|
-
<xsl:
|
|
10343
|
+
<xsl:apply-templates select="*" mode="copy-authored-html"/>
|
|
10344
|
+
</xsl:template>
|
|
10345
|
+
|
|
10346
|
+
<!-- Attributes in the internal namespace are the assembly's -->
|
|
10347
|
+
<!-- identification stamps, not the author's work, so they stay -->
|
|
10348
|
+
<!-- out of the copy. -->
|
|
10349
|
+
<xsl:template match="*" mode="copy-authored-html">
|
|
10350
|
+
<xsl:element name="{name()}" namespace="{namespace-uri()}">
|
|
10351
|
+
<xsl:copy-of select="@*[namespace-uri(.) != 'http://pretextbook.org/2020/pretext/internal']"/>
|
|
10352
|
+
<xsl:apply-templates select="node()" mode="copy-authored-html"/>
|
|
10353
|
+
</xsl:element>
|
|
10354
|
+
</xsl:template>
|
|
10355
|
+
|
|
10356
|
+
<xsl:template match="text()|comment()|processing-instruction()" mode="copy-authored-html">
|
|
10357
|
+
<xsl:copy/>
|
|
10337
10358
|
</xsl:template>
|
|
10338
10359
|
|
|
10339
10360
|
<!-- Similar to the "div" surface, but with class information -->
|
|
@@ -10397,7 +10418,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
10397
10418
|
<!-- ensure identifier does not lead with a digit, so "ggb_". -->
|
|
10398
10419
|
<xsl:variable name="applet-name">
|
|
10399
10420
|
<xsl:text>ggb_</xsl:text>
|
|
10400
|
-
<xsl:apply-templates select="." mode="
|
|
10421
|
+
<xsl:apply-templates select="." mode="unique-id-no-dash" />
|
|
10401
10422
|
</xsl:variable>
|
|
10402
10423
|
<!-- And a Javascript identifier for the parameters -->
|
|
10403
10424
|
<xsl:variable name="applet-parameters">
|
|
@@ -10417,7 +10438,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
10417
10438
|
</xsl:variable>
|
|
10418
10439
|
<!-- And an HTML unique identifier -->
|
|
10419
10440
|
<xsl:variable name="applet-container">
|
|
10420
|
-
<xsl:apply-templates select="." mode="
|
|
10441
|
+
<xsl:apply-templates select="." mode="unique-id" />
|
|
10421
10442
|
<xsl:text>-container</xsl:text>
|
|
10422
10443
|
</xsl:variable>
|
|
10423
10444
|
<!-- Javascript API for loading GeoGebra -->
|
|
@@ -10597,7 +10618,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
10597
10618
|
<!-- the div that jsxgraph will take over -->
|
|
10598
10619
|
<xsl:element name="div">
|
|
10599
10620
|
<xsl:attribute name="id">
|
|
10600
|
-
<xsl:apply-templates select="." mode="
|
|
10621
|
+
<xsl:apply-templates select="." mode="unique-id" />
|
|
10601
10622
|
</xsl:attribute>
|
|
10602
10623
|
<xsl:attribute name="class">
|
|
10603
10624
|
<xsl:text>jxgbox</xsl:text>
|
|
@@ -10613,7 +10634,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
10613
10634
|
</xsl:attribute>
|
|
10614
10635
|
<!-- Put the board in the appropriate container. -->
|
|
10615
10636
|
<xsl:attribute name="container">
|
|
10616
|
-
<xsl:apply-templates select="." mode="
|
|
10637
|
+
<xsl:apply-templates select="." mode="unique-id" />
|
|
10617
10638
|
</xsl:attribute>
|
|
10618
10639
|
<xsl:if test="@boundingbox">
|
|
10619
10640
|
<xsl:attribute name="boundingbox">
|
|
@@ -10643,7 +10664,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
10643
10664
|
</xsl:attribute>
|
|
10644
10665
|
<xsl:text>function parseJessie(code) {
</xsl:text>
|
|
10645
10666
|
<xsl:text> let board = JXG.JSXGraph.initBoard('</xsl:text>
|
|
10646
|
-
<xsl:apply-templates select="." mode="
|
|
10667
|
+
<xsl:apply-templates select="." mode="unique-id" />
|
|
10647
10668
|
<xsl:text>', {</xsl:text>
|
|
10648
10669
|
<xsl:if test="@boundingbox">
|
|
10649
10670
|
<xsl:text>boundingbox:[</xsl:text>
|
|
@@ -10911,7 +10932,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
10911
10932
|
</xsl:template>
|
|
10912
10933
|
|
|
10913
10934
|
<xsl:template match="interactive" mode="get-resize-behavior">
|
|
10914
|
-
<xsl:variable name="platform" select="@interactive-platform"/>
|
|
10935
|
+
<xsl:variable name="platform" select="@pi:interactive-platform"/>
|
|
10915
10936
|
<xsl:choose>
|
|
10916
10937
|
<xsl:when test="@resize-behavior != ''">
|
|
10917
10938
|
<xsl:value-of select="@resize-behavior"/>
|
|
@@ -11011,7 +11032,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
11011
11032
|
<!-- the div to hold the JSX output -->
|
|
11012
11033
|
<xsl:element name="div">
|
|
11013
11034
|
<xsl:attribute name="id">
|
|
11014
|
-
<xsl:apply-templates select="." mode="
|
|
11035
|
+
<xsl:apply-templates select="." mode="unique-id" />
|
|
11015
11036
|
</xsl:attribute>
|
|
11016
11037
|
<xsl:attribute name="class">
|
|
11017
11038
|
<xsl:text>jxgbox</xsl:text>
|
|
@@ -11119,10 +11140,10 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
11119
11140
|
<!-- (or PROJECT-LIKE). So in this case (only) we place -->
|
|
11120
11141
|
<!-- an id value on the div.exercise-wrapper that is -->
|
|
11121
11142
|
<!-- derived from the parent. Otherwise, we use the -->
|
|
11122
|
-
<!-- parent @assembly-id with a "-ww-inner" suffix.
|
|
11143
|
+
<!-- parent @pi:assembly-id with a "-ww-inner" suffix. -->
|
|
11123
11144
|
<!-- The suffix ensures the inner wrapper's DOM id is -->
|
|
11124
11145
|
<!-- distinct from the enclosing "exercise" article's -->
|
|
11125
|
-
<!-- id (which also holds the @assembly-id value).
|
|
11146
|
+
<!-- id (which also holds the @pi:assembly-id value). -->
|
|
11126
11147
|
<!-- Without the suffix, JavaScript (handleWW) would -->
|
|
11127
11148
|
<!-- look up the inner id with getElementById and find -->
|
|
11128
11149
|
<!-- the outer "exercise" article instead. -->
|
|
@@ -11133,7 +11154,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
11133
11154
|
<xsl:text>-ww-rs</xsl:text>
|
|
11134
11155
|
</xsl:when>
|
|
11135
11156
|
<xsl:otherwise>
|
|
11136
|
-
<xsl:value-of select="concat(@assembly-id, '-ww-inner')"/>
|
|
11157
|
+
<xsl:value-of select="concat(@pi:assembly-id, '-ww-inner')"/>
|
|
11137
11158
|
</xsl:otherwise>
|
|
11138
11159
|
</xsl:choose>
|
|
11139
11160
|
</xsl:variable>
|
|
@@ -11281,7 +11302,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
11281
11302
|
</xsl:variable>
|
|
11282
11303
|
<!-- build the iframe -->
|
|
11283
11304
|
<!-- mimicking Mike Gage's blog post -->
|
|
11284
|
-
<iframe name="{concat(@assembly-id, '-ww-inner')}" width="{$design-width}" src="{$the-url}" data-seed="{static/@seed}"/>
|
|
11305
|
+
<iframe name="{concat(@pi:assembly-id, '-ww-inner')}" width="{$design-width}" src="{$the-url}" data-seed="{static/@seed}"/>
|
|
11285
11306
|
<script>
|
|
11286
11307
|
<xsl:text>iFrameResize({log:true,inPageLinks:true,resizeFrom:'child',checkOrigin:["</xsl:text>
|
|
11287
11308
|
<xsl:value-of select="$webwork-server" />
|
|
@@ -11665,7 +11686,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
11665
11686
|
<xsl:param name="content" />
|
|
11666
11687
|
<xsl:variable name="filename">
|
|
11667
11688
|
<!-- do not use "containing-filename" may be different -->
|
|
11668
|
-
<xsl:apply-templates select="." mode="
|
|
11689
|
+
<xsl:apply-templates select="." mode="unique-id" />
|
|
11669
11690
|
<text>.html</text>
|
|
11670
11691
|
</xsl:variable>
|
|
11671
11692
|
<exsl:document href="{$filename}" method="html" indent="yes" encoding="UTF-8" doctype-system="about:legacy-compat">
|
|
@@ -12985,7 +13006,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
12985
13006
|
</xsl:attribute>
|
|
12986
13007
|
<!-- copy id of this li for use in customization pass -->
|
|
12987
13008
|
<xsl:attribute name="uid">
|
|
12988
|
-
<xsl:value-of select="@unique-id"/>
|
|
13009
|
+
<xsl:value-of select="@pi:unique-id"/>
|
|
12989
13010
|
</xsl:attribute>
|
|
12990
13011
|
<div class="toc-title-box">
|
|
12991
13012
|
<a href="{$the-url}" class="internal">
|
|
@@ -13019,7 +13040,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
13019
13040
|
</xsl:attribute>
|
|
13020
13041
|
<!-- copy id of this li for use in customization pass, will remove there -->
|
|
13021
13042
|
<xsl:attribute name="uid">
|
|
13022
|
-
<xsl:value-of select="@unique-id"/>
|
|
13043
|
+
<xsl:value-of select="@pi:unique-id"/>
|
|
13023
13044
|
</xsl:attribute>
|
|
13024
13045
|
<div class="toc-title-box">
|
|
13025
13046
|
<a href="{$the-url}" class="internal">
|
|
@@ -13047,7 +13068,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
13047
13068
|
<xsl:variable name="toc-contents" select="exsl:node-set($toc-contents-rtf)"/>
|
|
13048
13069
|
|
|
13049
13070
|
<!-- get the unique id of the current page -->
|
|
13050
|
-
<xsl:variable name="uid" select="@unique-id"/>
|
|
13071
|
+
<xsl:variable name="uid" select="@pi:unique-id"/>
|
|
13051
13072
|
<!-- use that to find the ToC node for that page -->
|
|
13052
13073
|
<xsl:variable name="this-page-node" select="$toc-contents//*[@uid = $uid]"/>
|
|
13053
13074
|
<!-- ancestor list will allow us to identify when we are in the path to the page -->
|
|
@@ -14545,7 +14566,9 @@ TODO:
|
|
|
14545
14566
|
</a>
|
|
14546
14567
|
</xsl:when>
|
|
14547
14568
|
<xsl:otherwise>
|
|
14569
|
+
<span id="logo-link" class="logo-link">
|
|
14548
14570
|
<img src="{$location}" alt="Logo image"/>
|
|
14571
|
+
</span>
|
|
14549
14572
|
</xsl:otherwise>
|
|
14550
14573
|
</xsl:choose>
|
|
14551
14574
|
</xsl:if>
|
|
@@ -14671,7 +14694,7 @@ TODO:
|
|
|
14671
14694
|
<!-- We put page-margins-attributes only on printout sections -->
|
|
14672
14695
|
<xsl:template match="*" mode="page-margins-attribute"/>
|
|
14673
14696
|
|
|
14674
|
-
<xsl:template match="
|
|
14697
|
+
<xsl:template match="&PRINTOUT;" mode="page-margins-attribute">
|
|
14675
14698
|
<xsl:attribute name="data-margins">
|
|
14676
14699
|
<!-- A space-separated list for top, right, bottom, and left margins -->
|
|
14677
14700
|
<xsl:apply-templates select="." mode="printout-margin">
|
|
@@ -14699,7 +14722,7 @@ TODO:
|
|
|
14699
14722
|
<!-- Add data-* attributes for headers and footers -->
|
|
14700
14723
|
<xsl:template match="*" mode="page-header-footer-attributes"/>
|
|
14701
14724
|
|
|
14702
|
-
<xsl:template match="
|
|
14725
|
+
<xsl:template match="&PRINTOUT;" mode="page-header-footer-attributes">
|
|
14703
14726
|
<xsl:if test="not($ws-header-first-left = '')">
|
|
14704
14727
|
<xsl:attribute name="data-header-first-left">
|
|
14705
14728
|
<xsl:value-of select="normalize-space($ws-header-first-left)"/>
|
|
@@ -3971,7 +3971,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
3971
3971
|
<xsl:variable name="b-is-specialized" select="boolean(self::exercises|self::solutions[not(parent::backmatter)]|self::reading-questions|self::glossary|self::references|self::worksheet|self::handout|self::index)"/>
|
|
3972
3972
|
|
|
3973
3973
|
<!-- change geometry if worksheet or handout should be formatted -->
|
|
3974
|
-
<xsl:if test="(
|
|
3974
|
+
<xsl:if test="(&PRINTOUT-FILTER;) and $b-latex-worksheet-formatted">
|
|
3975
3975
|
<!-- \newgeometry includes a \clearpage -->
|
|
3976
3976
|
<xsl:apply-templates select="." mode="new-geometry"/>
|
|
3977
3977
|
</xsl:if>
|
|
@@ -4076,7 +4076,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
4076
4076
|
<!-- the four margins, in units LaTeX understands (such as -->
|
|
4077
4077
|
<!-- cm, in, pt). This only produces text, so could go in -->
|
|
4078
4078
|
<!-- -common, but is also only useful for LaTeX output. -->
|
|
4079
|
-
<xsl:template match="
|
|
4079
|
+
<xsl:template match="&PRINTOUT;" mode="new-geometry">
|
|
4080
4080
|
<!-- Four similar "choose" effect hierarchy/priority -->
|
|
4081
4081
|
<!-- NB: a publisher string parameter to -->
|
|
4082
4082
|
<!-- *really* override (worksheet.left, etc.) -->
|
|
@@ -4117,7 +4117,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
4117
4117
|
<!-- possibly numberless -->
|
|
4118
4118
|
<xsl:apply-templates select="." mode="division-environment-name-suffix" />
|
|
4119
4119
|
<xsl:text>}
</xsl:text>
|
|
4120
|
-
<xsl:if test="(
|
|
4120
|
+
<xsl:if test="(&PRINTOUT-FILTER;) and $b-latex-worksheet-formatted">
|
|
4121
4121
|
<!-- \restoregeometry includes a \clearpage -->
|
|
4122
4122
|
<xsl:text>\restoregeometry
</xsl:text>
|
|
4123
4123
|
</xsl:if>
|
|
@@ -4531,7 +4531,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
4531
4531
|
<xsl:choose>
|
|
4532
4532
|
<xsl:when test="self::task">project</xsl:when>
|
|
4533
4533
|
<xsl:otherwise>
|
|
4534
|
-
<xsl:value-of select="./@exercise-customization"/>
|
|
4534
|
+
<xsl:value-of select="./@pi:exercise-customization"/>
|
|
4535
4535
|
</xsl:otherwise>
|
|
4536
4536
|
</xsl:choose>
|
|
4537
4537
|
</xsl:variable>
|
|
@@ -5614,8 +5614,8 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
5614
5614
|
<!-- Utility templates to translate @marker specification -->
|
|
5615
5615
|
<!-- for use with LaTeX enumitem package's label keyword -->
|
|
5616
5616
|
<xsl:template match="ol" mode="latex-list-label">
|
|
5617
|
-
<xsl:variable name="format-code" select="./@format-code" />
|
|
5618
|
-
<xsl:value-of select="./@marker-prefix" />
|
|
5617
|
+
<xsl:variable name="format-code" select="./@pi:format-code" />
|
|
5618
|
+
<xsl:value-of select="./@pi:marker-prefix" />
|
|
5619
5619
|
<xsl:choose>
|
|
5620
5620
|
<xsl:when test="$format-code = '0'">\arabic*</xsl:when>
|
|
5621
5621
|
<xsl:when test="$format-code = '1'">\arabic*</xsl:when>
|
|
@@ -5627,7 +5627,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
5627
5627
|
<xsl:message>PTX:BUG: bad ordered list label format code in LaTeX conversion</xsl:message>
|
|
5628
5628
|
</xsl:otherwise>
|
|
5629
5629
|
</xsl:choose>
|
|
5630
|
-
<xsl:value-of select="./@marker-suffix" />
|
|
5630
|
+
<xsl:value-of select="./@pi:marker-suffix" />
|
|
5631
5631
|
</xsl:template>
|
|
5632
5632
|
|
|
5633
5633
|
<xsl:template match="ul" mode="latex-list-label">
|
|
@@ -5672,7 +5672,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
5672
5672
|
<xsl:template match="ol">
|
|
5673
5673
|
<!-- need to switch on 0-1 for ol Arabic -->
|
|
5674
5674
|
<!-- no harm if called on "ul" -->
|
|
5675
|
-
<xsl:variable name="format-code" select="./@format-code" />
|
|
5675
|
+
<xsl:variable name="format-code" select="./@pi:format-code" />
|
|
5676
5676
|
<!-- Determine the number of columns -->
|
|
5677
5677
|
<!-- Restrict to 1-6 via the schema -->
|
|
5678
5678
|
<xsl:variable name="ncols">
|