@pretextbook/pretext-html 0.6.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -2
- package/assets/upstream.json +1 -1
- package/assets/xsl/LICENSE-pretext +1 -1
- package/assets/xsl/README.md +19 -0
- package/assets/xsl/entities.ent +15 -4
- package/assets/xsl/extract-asymptote.xsl +5 -5
- package/assets/xsl/extract-biblio-csl.xsl +1 -1
- package/assets/xsl/extract-datafile.xsl +1 -1
- package/assets/xsl/extract-dynamic.xsl +1 -1
- package/assets/xsl/extract-identity.xsl +5 -5
- package/assets/xsl/extract-interactive.xsl +1 -1
- package/assets/xsl/extract-latex-image.xsl +5 -5
- package/assets/xsl/extract-mermaid.xsl +1 -1
- package/assets/xsl/extract-mom.xsl +5 -5
- package/assets/xsl/extract-pg.xsl +1 -1
- package/assets/xsl/extract-prefigure.xsl +5 -5
- package/assets/xsl/extract-qrcode.xsl +1 -1
- package/assets/xsl/extract-runestone-page-template.xsl +1 -1
- package/assets/xsl/extract-sageplot.xsl +5 -5
- package/assets/xsl/extract-stack.xsl +1 -1
- package/assets/xsl/extract-trace.xsl +1 -1
- package/assets/xsl/extract-youtube.xsl +5 -5
- package/assets/xsl/latex/pretext-latex-AIM.xsl +1 -1
- package/assets/xsl/latex/pretext-latex-chaos.xsl +1 -1
- package/assets/xsl/latex/pretext-latex-dyslexic-font.xsl +1 -1
- package/assets/xsl/latex/pretext-latex-guide.xsl +1 -1
- package/assets/xsl/localizations/README.md +1 -1
- package/assets/xsl/localizations/af-ZA.xml +1 -1
- package/assets/xsl/localizations/bg-BG.xml +1 -1
- package/assets/xsl/localizations/ca-ES.xml +1 -1
- package/assets/xsl/localizations/cs-CZ.xml +1 -1
- package/assets/xsl/localizations/de-DE.xml +1 -1
- package/assets/xsl/localizations/en-US.xml +1 -1
- package/assets/xsl/localizations/es-ES.xml +1 -1
- package/assets/xsl/localizations/fi-FI.xml +1 -1
- package/assets/xsl/localizations/fr-CA.xml +1 -1
- package/assets/xsl/localizations/fr-FR.xml +1 -1
- package/assets/xsl/localizations/hu-HU.xml +1 -1
- package/assets/xsl/localizations/it-IT.xml +1 -1
- package/assets/xsl/localizations/ku-CKB.xml +1 -1
- package/assets/xsl/localizations/localizations.xml +1 -1
- package/assets/xsl/localizations/nl-NL.xml +1 -1
- package/assets/xsl/localizations/pt-BR.xml +1 -1
- package/assets/xsl/localizations/pt-PT.xml +1 -1
- package/assets/xsl/localizations/zh-HANS.xml +1 -1
- package/assets/xsl/pretext-assembly.xsl +66 -7
- package/assets/xsl/pretext-basic-html.xsl +5 -5
- package/assets/xsl/pretext-braille-preprint.xsl +5 -5
- package/assets/xsl/pretext-common.xsl +123 -32
- package/assets/xsl/pretext-dynamic.xsl +1 -1
- package/assets/xsl/pretext-epub.xsl +94 -85
- package/assets/xsl/pretext-fo.xsl +18 -20
- package/assets/xsl/pretext-html.xsl +260 -74
- package/assets/xsl/pretext-json-manifest.xsl +1 -1
- package/assets/xsl/pretext-jupyter.xsl +5 -5
- package/assets/xsl/pretext-latex-classic.xsl +1 -1
- package/assets/xsl/pretext-latex-common.xsl +35 -22
- package/assets/xsl/pretext-latex.xsl +3 -3
- package/assets/xsl/pretext-litprog.xsl +9 -2
- package/assets/xsl/pretext-markdown.xsl +1 -1
- package/assets/xsl/pretext-numbers.xsl +1 -1
- package/assets/xsl/pretext-revealjs.xsl +1 -3
- package/assets/xsl/pretext-runestone-fitb.xsl +18 -0
- package/assets/xsl/pretext-runestone-static.xsl +13 -1
- package/assets/xsl/pretext-runestone.xsl +39 -27
- package/assets/xsl/pretext-sage-doctest.xsl +18 -0
- package/assets/xsl/pretext-solution-manual-latex.xsl +4 -4
- package/assets/xsl/pretext-text-utilities.xsl +1 -1
- package/assets/xsl/pretext-text.xsl +5 -5
- package/assets/xsl/pretext-units.xsl +5 -5
- package/assets/xsl/pretext-view-source.xsl +1 -1
- package/assets/xsl/pretext-ww-problem-sets.xsl +15 -12
- package/assets/xsl/publisher-variables.xsl +160 -133
- package/assets/xsl/support/README.md +19 -0
- package/assets/xsl/support/extract-math.xsl +1 -1
- package/assets/xsl/support/package-math.xsl +1 -1
- package/assets/xsl/support/webpack_static_imports.xml +19 -0
- package/assets/xsl/tests/README.md +19 -0
- package/assets/xsl/tests/null.xml +19 -0
- package/assets/xsl/tests/pretext-text-utilities-test.xsl +1 -1
- package/assets/xsl/utilities/README.md +19 -0
- package/assets/xsl/utilities/author-report.xsl +1 -1
- package/assets/xsl/utilities/fix-deprecations.xsl +5 -5
- package/assets/xsl/utilities/pretext-enhanced-source.xsl +1 -1
- package/assets/xsl/utilities/report-publisher-variables.xsl +5 -5
- package/assets/xsl/xml-to-json.xsl +4 -4
- package/assets/xsl-bundle.json +1 -1
- package/dist/banner.d.ts +51 -0
- package/dist/{cli-DF7XOWN7.js → cli-Bcn4t3B1.js} +387 -240
- package/dist/cli.js +2 -2
- package/dist/html-static.d.ts +20 -0
- package/dist/index.browser.d.ts +2 -0
- package/dist/index.browser.js +554 -407
- package/dist/index.d.ts +2 -0
- package/dist/index.js +28 -25
- package/dist/renderer.d.ts +18 -1
- package/package.json +2 -1
- package/assets/xsl/pretext-smc.xsl +0 -492
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
<?xml version='1.0'?> <!-- As XML file -->
|
|
2
2
|
|
|
3
3
|
<!--********************************************************************
|
|
4
|
-
Copyright 2013
|
|
4
|
+
Copyright (C) 2013-2026 Robert A. Beezer
|
|
5
5
|
|
|
6
|
-
This file is part of
|
|
6
|
+
This file is part of PreTeXt.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
PreTeXt is free software: you can redistribute it and/or modify
|
|
9
9
|
it under the terms of the GNU General Public License as published by
|
|
10
10
|
the Free Software Foundation, either version 2 or version 3 of the
|
|
11
11
|
License (at your option).
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
PreTeXt is distributed in the hope that it will be useful,
|
|
14
14
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
15
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
16
|
GNU General Public License for more details.
|
|
17
17
|
|
|
18
18
|
You should have received a copy of the GNU General Public License
|
|
19
|
-
along with
|
|
19
|
+
along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
20
20
|
*********************************************************************-->
|
|
21
21
|
|
|
22
22
|
<!-- http://pimpmyxslt.com/articles/entity-tricks-part2/ -->
|
|
@@ -137,6 +137,8 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
137
137
|
<xsl:when test="$root/book/article">3</xsl:when>
|
|
138
138
|
<xsl:when test="$root/book">2</xsl:when>
|
|
139
139
|
<xsl:when test="$root/article">0</xsl:when>
|
|
140
|
+
<!-- a "slideshow" needs a value here for "latex-image" extraction -->
|
|
141
|
+
<xsl:when test="$root/slideshow">0</xsl:when>
|
|
140
142
|
<xsl:when test="$root/letter">0</xsl:when>
|
|
141
143
|
<xsl:when test="$root/memo">0</xsl:when>
|
|
142
144
|
<xsl:otherwise>
|
|
@@ -2172,7 +2174,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
2172
2174
|
<xsl:text>}
</xsl:text>
|
|
2173
2175
|
</xsl:template>
|
|
2174
2176
|
|
|
2175
|
-
<!-- Vertical workspace for worksheets and
|
|
2177
|
+
<!-- Vertical workspace for worksheets, handouts, and PROJECT-LIKE with workspace -->
|
|
2176
2178
|
<xsl:template match="*" mode="workspace">
|
|
2177
2179
|
<xsl:variable name="vertical-space">
|
|
2178
2180
|
<xsl:apply-templates select="." mode="sanitize-workspace"/>
|
|
@@ -4076,7 +4078,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
4076
4078
|
<!-- the four margins, in units LaTeX understands (such as -->
|
|
4077
4079
|
<!-- cm, in, pt). This only produces text, so could go in -->
|
|
4078
4080
|
<!-- -common, but is also only useful for LaTeX output. -->
|
|
4079
|
-
<xsl:template match="&PRINTOUT;" mode="new-geometry">
|
|
4081
|
+
<xsl:template match="&PRINTOUT;|&PROJECT-LIKE;" mode="new-geometry">
|
|
4080
4082
|
<!-- Four similar "choose" effect hierarchy/priority -->
|
|
4081
4083
|
<!-- NB: a publisher string parameter to -->
|
|
4082
4084
|
<!-- *really* override (worksheet.left, etc.) -->
|
|
@@ -4554,6 +4556,21 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
4554
4556
|
</xsl:variable>
|
|
4555
4557
|
<xsl:variable name="ex-components-report" select="exsl:node-set($ex-components-rtf)/exercise-component-report"/>
|
|
4556
4558
|
|
|
4559
|
+
<!-- A PROJECT-LIKE requesting workspace outside of any printout is a -->
|
|
4560
|
+
<!-- printout in its own right, so give it pages of its own with the -->
|
|
4561
|
+
<!-- worksheet margins, exactly as a worksheet or handout division gets -->
|
|
4562
|
+
<!-- (see "latex-division-heading"). Compute the test once, since the -->
|
|
4563
|
+
<!-- matching \restoregeometry below must fire under precisely the same -->
|
|
4564
|
+
<!-- condition or the geometry group will not balance. -->
|
|
4565
|
+
<xsl:variable name="standalone-printout">
|
|
4566
|
+
<xsl:apply-templates select="." mode="is-standalone-printout"/>
|
|
4567
|
+
</xsl:variable>
|
|
4568
|
+
<xsl:variable name="b-own-pages" select="($standalone-printout = 'true') and $b-latex-worksheet-formatted"/>
|
|
4569
|
+
|
|
4570
|
+
<xsl:if test="$b-own-pages">
|
|
4571
|
+
<!-- \newgeometry includes a \clearpage -->
|
|
4572
|
+
<xsl:apply-templates select="." mode="new-geometry"/>
|
|
4573
|
+
</xsl:if>
|
|
4557
4574
|
<!-- structured version of a project-like may contain a -->
|
|
4558
4575
|
<!-- prelude, which is rendered *before* environment begins -->
|
|
4559
4576
|
<xsl:if test="$project and (statement or task)">
|
|
@@ -4638,6 +4655,12 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
4638
4655
|
<xsl:if test="$project and (statement or task)">
|
|
4639
4656
|
<xsl:apply-templates select="postlude" />
|
|
4640
4657
|
</xsl:if>
|
|
4658
|
+
<!-- Give back the page geometry claimed above, under exactly the same -->
|
|
4659
|
+
<!-- condition. Matches the worksheet's "latex-division-footing". -->
|
|
4660
|
+
<xsl:if test="$b-own-pages">
|
|
4661
|
+
<!-- \restoregeometry includes a \clearpage -->
|
|
4662
|
+
<xsl:text>\restoregeometry
</xsl:text>
|
|
4663
|
+
</xsl:if>
|
|
4641
4664
|
</xsl:template>
|
|
4642
4665
|
|
|
4643
4666
|
<!-- ######################### -->
|
|
@@ -7322,9 +7345,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
7322
7345
|
<!-- need image filename in two different scenarios -->
|
|
7323
7346
|
<xsl:variable name="image-file-name">
|
|
7324
7347
|
<xsl:value-of select="$generated-directory"/>
|
|
7325
|
-
<xsl:
|
|
7326
|
-
<xsl:text>asymptote/</xsl:text>
|
|
7327
|
-
</xsl:if>
|
|
7348
|
+
<xsl:text>asymptote/</xsl:text>
|
|
7328
7349
|
<xsl:apply-templates select="asymptote" mode="image-source-basename"/>
|
|
7329
7350
|
<xsl:text>.pdf</xsl:text>
|
|
7330
7351
|
</xsl:variable>
|
|
@@ -7333,9 +7354,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
7333
7354
|
<xsl:variable name="image-html-url">
|
|
7334
7355
|
<xsl:value-of select="$baseurl"/>
|
|
7335
7356
|
<xsl:value-of select="$generated-directory"/>
|
|
7336
|
-
<xsl:
|
|
7337
|
-
<xsl:text>asymptote/</xsl:text>
|
|
7338
|
-
</xsl:if>
|
|
7357
|
+
<xsl:text>asymptote/</xsl:text>
|
|
7339
7358
|
<xsl:apply-templates select="asymptote" mode="image-source-basename"/>
|
|
7340
7359
|
<xsl:text>.html</xsl:text>
|
|
7341
7360
|
</xsl:variable>
|
|
@@ -7366,9 +7385,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
7366
7385
|
<xsl:text>\includegraphics[width=\linewidth]</xsl:text>
|
|
7367
7386
|
<xsl:text>{</xsl:text>
|
|
7368
7387
|
<xsl:value-of select="$generated-directory"/>
|
|
7369
|
-
<xsl:
|
|
7370
|
-
<xsl:text>sageplot/</xsl:text>
|
|
7371
|
-
</xsl:if>
|
|
7388
|
+
<xsl:text>sageplot/</xsl:text>
|
|
7372
7389
|
<xsl:apply-templates select="sageplot" mode="image-source-basename"/>
|
|
7373
7390
|
<xsl:choose>
|
|
7374
7391
|
<xsl:when test="not(sageplot/@variant) or (sageplot/@variant = '2d')">
|
|
@@ -7391,9 +7408,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
7391
7408
|
<xsl:text>\includegraphics[width=\linewidth]</xsl:text>
|
|
7392
7409
|
<xsl:text>{</xsl:text>
|
|
7393
7410
|
<xsl:value-of select="$generated-directory"/>
|
|
7394
|
-
<xsl:
|
|
7395
|
-
<xsl:text>mermaid/</xsl:text>
|
|
7396
|
-
</xsl:if>
|
|
7411
|
+
<xsl:text>mermaid/</xsl:text>
|
|
7397
7412
|
<xsl:apply-templates select="mermaid" mode="image-source-basename"/>
|
|
7398
7413
|
<xsl:text>.png</xsl:text>
|
|
7399
7414
|
<xsl:text>}%
</xsl:text>
|
|
@@ -7404,9 +7419,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
7404
7419
|
<xsl:text>\includegraphics[width=\linewidth]</xsl:text>
|
|
7405
7420
|
<xsl:text>{</xsl:text>
|
|
7406
7421
|
<xsl:value-of select="$generated-directory"/>
|
|
7407
|
-
<xsl:
|
|
7408
|
-
<xsl:text>prefigure/</xsl:text>
|
|
7409
|
-
</xsl:if>
|
|
7422
|
+
<xsl:text>prefigure/</xsl:text>
|
|
7410
7423
|
<xsl:apply-templates select="pf:prefigure" mode="image-source-basename"/>
|
|
7411
7424
|
<xsl:text>.pdf</xsl:text>
|
|
7412
7425
|
<xsl:text>}%
</xsl:text>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<?xml version='1.0'?>
|
|
2
2
|
|
|
3
3
|
<!--********************************************************************
|
|
4
|
-
Copyright 2020
|
|
4
|
+
Copyright (C) 2020-2026 Robert A. Beezer
|
|
5
5
|
|
|
6
6
|
This file is part of PreTeXt.
|
|
7
7
|
|
|
@@ -505,11 +505,11 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
505
505
|
<xsl:apply-templates select="." mode="subtitle" />
|
|
506
506
|
<xsl:text>}</xsl:text>
|
|
507
507
|
</xsl:if>
|
|
508
|
-
<xsl:if test="$
|
|
508
|
+
<xsl:if test="$bibinfo/event">
|
|
509
509
|
<xsl:if test="title">
|
|
510
510
|
<xsl:text>\\</xsl:text>
|
|
511
511
|
</xsl:if>
|
|
512
|
-
<xsl:apply-templates select="$
|
|
512
|
+
<xsl:apply-templates select="$bibinfo/event" />
|
|
513
513
|
</xsl:if>
|
|
514
514
|
<xsl:if test="$bibinfo/support">
|
|
515
515
|
<xsl:text>\ptxsupport{</xsl:text>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<?xml version='1.0'?> <!-- As XML file -->
|
|
2
2
|
|
|
3
3
|
<!--********************************************************************
|
|
4
|
-
Copyright 2013-
|
|
4
|
+
Copyright (C) 2013-2026 Robert A. Beezer
|
|
5
5
|
|
|
6
6
|
This file is part of PreTeXt.
|
|
7
7
|
|
|
@@ -87,12 +87,19 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
87
87
|
<!-- Duplicate code, rather than default sanitization, so author -->
|
|
88
88
|
<!-- needs to be cognizant of indentation in PreTeXt source and -->
|
|
89
89
|
<!-- resulting indentation of output -->
|
|
90
|
+
<!-- -->
|
|
91
|
+
<!-- A "code" ends with whitespace indenting its closing tag, -->
|
|
92
|
+
<!-- which would otherwise become a whitespace-only line where -->
|
|
93
|
+
<!-- two fragments join, so trailing whitespace is trimmed away. -->
|
|
94
|
+
<!-- Leading indentation is untouched, the author's to own. -->
|
|
90
95
|
<!-- TODO: indentation/relative indentation specification on a "fragment"? -->
|
|
91
96
|
<!-- In "indentation units" with global value in spaces (or tabs?)? -->
|
|
92
97
|
<!-- TODO: or maybe a "mangle" attribute (newlines, and/or more) -->
|
|
93
98
|
<!-- TODO: global switch to minify (remove indentation, remove newlines?) -->
|
|
94
99
|
<xsl:template match="fragment/code">
|
|
95
|
-
<xsl:
|
|
100
|
+
<xsl:call-template name="trim-end">
|
|
101
|
+
<xsl:with-param name="text" select="."/>
|
|
102
|
+
</xsl:call-template>
|
|
96
103
|
</xsl:template>
|
|
97
104
|
|
|
98
105
|
<!-- As we process a fragment, a mix of code and pointers, -->
|
|
@@ -633,9 +633,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
633
633
|
<xsl:when test="$b-reveal-embedded-math">
|
|
634
634
|
<xsl:variable name="base-pathname">
|
|
635
635
|
<xsl:value-of select="$generated-directory"/>
|
|
636
|
-
<xsl:
|
|
637
|
-
<xsl:text>prefigure/</xsl:text>
|
|
638
|
-
</xsl:if>
|
|
636
|
+
<xsl:text>prefigure/</xsl:text>
|
|
639
637
|
<xsl:apply-templates select="pf:prefigure" mode="image-source-basename"/>
|
|
640
638
|
</xsl:variable>
|
|
641
639
|
<xsl:apply-templates select="." mode="svg-png-wrapper">
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
<?xml version='1.0'?> <!-- As XML file -->
|
|
2
2
|
|
|
3
|
+
<!--********************************************************************
|
|
4
|
+
Copyright (C) 2023-2026 Robert A. Beezer
|
|
5
|
+
|
|
6
|
+
This file is part of PreTeXt.
|
|
7
|
+
|
|
8
|
+
PreTeXt is free software: you can redistribute it and/or modify
|
|
9
|
+
it under the terms of the GNU General Public License as published by
|
|
10
|
+
the Free Software Foundation, either version 2 or version 3 of the
|
|
11
|
+
License (at your option).
|
|
12
|
+
|
|
13
|
+
PreTeXt is distributed in the hope that it will be useful,
|
|
14
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
GNU General Public License for more details.
|
|
17
|
+
|
|
18
|
+
You should have received a copy of the GNU General Public License
|
|
19
|
+
along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*****************************************************************-->
|
|
3
21
|
<!DOCTYPE xsl:stylesheet>
|
|
4
22
|
|
|
5
23
|
<xsl:stylesheet
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<?xml version='1.0'?> <!-- As XML file -->
|
|
2
2
|
|
|
3
3
|
<!--********************************************************************
|
|
4
|
-
Copyright 2022
|
|
4
|
+
Copyright (C) 2022-2026 Robert A. Beezer
|
|
5
5
|
|
|
6
6
|
This file is part of PreTeXt.
|
|
7
7
|
|
|
@@ -55,11 +55,17 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
55
55
|
|
|
56
56
|
<!-- These get-programming-language templates duplicate logic from pretext-common -->
|
|
57
57
|
<!-- as the contents of that file are not available yet. -->
|
|
58
|
+
<!-- NB: these run during assembly, before the repair pass has produced the tree -->
|
|
59
|
+
<!-- behind $docinfo, so they read the version tree and must recognize both the -->
|
|
60
|
+
<!-- "docinfo/defaults" home (preferred) and the deprecated top-level placement. -->
|
|
58
61
|
<xsl:template match="program" mode="get-programming-language">
|
|
59
62
|
<xsl:choose>
|
|
60
63
|
<xsl:when test="@language">
|
|
61
64
|
<xsl:value-of select="@language" />
|
|
62
65
|
</xsl:when>
|
|
66
|
+
<xsl:when test="$version-docinfo/defaults/programs/@language">
|
|
67
|
+
<xsl:value-of select="$version-docinfo/defaults/programs/@language" />
|
|
68
|
+
</xsl:when>
|
|
63
69
|
<xsl:when test="$version-docinfo/programs/@language">
|
|
64
70
|
<xsl:value-of select="$version-docinfo/programs/@language" />
|
|
65
71
|
</xsl:when>
|
|
@@ -71,9 +77,15 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
71
77
|
<xsl:when test="@language">
|
|
72
78
|
<xsl:value-of select="@language" />
|
|
73
79
|
</xsl:when>
|
|
80
|
+
<xsl:when test="$version-docinfo/defaults/parsons/@language">
|
|
81
|
+
<xsl:value-of select="$version-docinfo/defaults/parsons/@language" />
|
|
82
|
+
</xsl:when>
|
|
74
83
|
<xsl:when test="$version-docinfo/parsons/@language">
|
|
75
84
|
<xsl:value-of select="$version-docinfo/parsons/@language" />
|
|
76
85
|
</xsl:when>
|
|
86
|
+
<xsl:when test="$version-docinfo/defaults/programs/@language">
|
|
87
|
+
<xsl:value-of select="$version-docinfo/defaults/programs/@language" />
|
|
88
|
+
</xsl:when>
|
|
77
89
|
<xsl:when test="$version-docinfo/programs/@language">
|
|
78
90
|
<xsl:value-of select="$version-docinfo/programs/@language" />
|
|
79
91
|
</xsl:when>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<?xml version='1.0'?> <!-- As XML file -->
|
|
2
2
|
|
|
3
3
|
<!--********************************************************************
|
|
4
|
-
Copyright 2022
|
|
4
|
+
Copyright (C) 2022-2026 Robert A. Beezer
|
|
5
5
|
|
|
6
6
|
This file is part of PreTeXt.
|
|
7
7
|
|
|
@@ -1426,15 +1426,8 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
1426
1426
|
<!-- NB: sample had paths with a leading backslash -->
|
|
1427
1427
|
<xsl:if test="@database">
|
|
1428
1428
|
<xsl:attribute name="data-dburl">
|
|
1429
|
-
<xsl:
|
|
1430
|
-
|
|
1431
|
-
<xsl:value-of select="$external-directory"/>
|
|
1432
|
-
<xsl:value-of select="@database"/>
|
|
1433
|
-
</xsl:when>
|
|
1434
|
-
<xsl:otherwise>
|
|
1435
|
-
<xsl:value-of select="@database"/>
|
|
1436
|
-
</xsl:otherwise>
|
|
1437
|
-
</xsl:choose>
|
|
1429
|
+
<xsl:value-of select="$external-directory"/>
|
|
1430
|
+
<xsl:value-of select="@database"/>
|
|
1438
1431
|
</xsl:attribute>
|
|
1439
1432
|
</xsl:if>
|
|
1440
1433
|
<!-- for natural language, just skip attribute -->
|
|
@@ -2292,12 +2285,40 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
2292
2285
|
<xsl:with-param name="hosting" select="$hosting"/>
|
|
2293
2286
|
</xsl:call-template>
|
|
2294
2287
|
<!-- CodeTailor: when an author requests it, emit the data -->
|
|
2295
|
-
<!--
|
|
2296
|
-
<!-- automatically-personalized Parsons puzzle as scaffolding
|
|
2288
|
+
<!-- The presence of @codetailor has Runestone offer the reader -->
|
|
2289
|
+
<!-- an automatically-personalized Parsons puzzle as scaffolding -->
|
|
2297
2290
|
<!-- (a "Get Help" button) when they are stuck on the exercise. -->
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2291
|
+
<!-- The value "all" scrambles a complete solution, while -->
|
|
2292
|
+
<!-- "incorrect" locks blocks the reader already has right, so -->
|
|
2293
|
+
<!-- only wrong ones move. A @codetailor-fallback names, by -->
|
|
2294
|
+
<!-- @xml:id, a Parsons problem of this document to present when -->
|
|
2295
|
+
<!-- a personalized puzzle cannot be generated; in its absence, -->
|
|
2296
|
+
<!-- generation is always requested. -->
|
|
2297
|
+
<xsl:if test="@codetailor">
|
|
2298
|
+
<xsl:attribute name="data-parsonspersonalize">
|
|
2299
|
+
<xsl:choose>
|
|
2300
|
+
<xsl:when test="@codetailor = 'incorrect'">
|
|
2301
|
+
<xsl:text>partial</xsl:text>
|
|
2302
|
+
</xsl:when>
|
|
2303
|
+
<!-- "all", the only other value the schema admits -->
|
|
2304
|
+
<xsl:otherwise>
|
|
2305
|
+
<xsl:text>movable</xsl:text>
|
|
2306
|
+
</xsl:otherwise>
|
|
2307
|
+
</xsl:choose>
|
|
2308
|
+
</xsl:attribute>
|
|
2309
|
+
<xsl:attribute name="data-parsonsexample">
|
|
2310
|
+
<xsl:choose>
|
|
2311
|
+
<xsl:when test="@codetailor-fallback">
|
|
2312
|
+
<xsl:call-template name="runestone-targets">
|
|
2313
|
+
<xsl:with-param name="id-list" select="@codetailor-fallback"/>
|
|
2314
|
+
<xsl:with-param name="separator" select="''"/>
|
|
2315
|
+
</xsl:call-template>
|
|
2316
|
+
</xsl:when>
|
|
2317
|
+
<xsl:otherwise>
|
|
2318
|
+
<xsl:text>LLM-example</xsl:text>
|
|
2319
|
+
</xsl:otherwise>
|
|
2320
|
+
</xsl:choose>
|
|
2321
|
+
</xsl:attribute>
|
|
2301
2322
|
</xsl:if>
|
|
2302
2323
|
<!-- This is a bit awful, but we need to figure out how much margin -->
|
|
2303
2324
|
<!-- to add to runestone dividers. It must match indentation used for -->
|
|
@@ -2556,15 +2577,8 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
2556
2577
|
<!-- This is a location in the external directory. -->
|
|
2557
2578
|
<xsl:if test="@database">
|
|
2558
2579
|
<xsl:attribute name="data-dburl">
|
|
2559
|
-
<xsl:
|
|
2560
|
-
|
|
2561
|
-
<xsl:value-of select="$external-directory"/>
|
|
2562
|
-
<xsl:value-of select="@database"/>
|
|
2563
|
-
</xsl:when>
|
|
2564
|
-
<xsl:otherwise>
|
|
2565
|
-
<xsl:value-of select="@database"/>
|
|
2566
|
-
</xsl:otherwise>
|
|
2567
|
-
</xsl:choose>
|
|
2580
|
+
<xsl:value-of select="$external-directory"/>
|
|
2581
|
+
<xsl:value-of select="@database"/>
|
|
2568
2582
|
</xsl:attribute>
|
|
2569
2583
|
</xsl:if>
|
|
2570
2584
|
</xsl:if>
|
|
@@ -2687,9 +2701,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
2687
2701
|
<!-- locate trace data via a *.js file, managed or not -->
|
|
2688
2702
|
<xsl:variable name="trace-file">
|
|
2689
2703
|
<xsl:value-of select="$generated-directory"/>
|
|
2690
|
-
<xsl:
|
|
2691
|
-
<xsl:text>trace/</xsl:text>
|
|
2692
|
-
</xsl:if>
|
|
2704
|
+
<xsl:text>trace/</xsl:text>
|
|
2693
2705
|
<xsl:apply-templates select="." mode="runestone-codelens-trace-filename"/>
|
|
2694
2706
|
</xsl:variable>
|
|
2695
2707
|
<!-- the Runestone HTML -->
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
<?xml version='1.0'?> <!-- As XML file -->
|
|
2
2
|
|
|
3
|
+
<!--********************************************************************
|
|
4
|
+
Copyright (C) 2013-2026 Robert A. Beezer
|
|
5
|
+
|
|
6
|
+
This file is part of PreTeXt.
|
|
7
|
+
|
|
8
|
+
PreTeXt is free software: you can redistribute it and/or modify
|
|
9
|
+
it under the terms of the GNU General Public License as published by
|
|
10
|
+
the Free Software Foundation, either version 2 or version 3 of the
|
|
11
|
+
License (at your option).
|
|
12
|
+
|
|
13
|
+
PreTeXt is distributed in the hope that it will be useful,
|
|
14
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
GNU General Public License for more details.
|
|
17
|
+
|
|
18
|
+
You should have received a copy of the GNU General Public License
|
|
19
|
+
along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*****************************************************************-->
|
|
3
21
|
<!-- http://pimpmyxslt.com/articles/entity-tricks-part2/ -->
|
|
4
22
|
<!DOCTYPE xsl:stylesheet [
|
|
5
23
|
<!ENTITY % entities SYSTEM "entities.ent">
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
<?xml version='1.0'?> <!-- As XML file -->
|
|
2
2
|
|
|
3
3
|
<!--********************************************************************
|
|
4
|
-
Copyright 2018
|
|
4
|
+
Copyright (C) 2018-2026 Robert A. Beezer
|
|
5
5
|
|
|
6
6
|
This file is part of PreTeXt.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
PreTeXt is free software: you can redistribute it and/or modify
|
|
9
9
|
it under the terms of the GNU General Public License as published by
|
|
10
10
|
the Free Software Foundation, either version 2 or version 3 of the
|
|
11
11
|
License (at your option).
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
PreTeXt is distributed in the hope that it will be useful,
|
|
14
14
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
15
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
16
|
GNU General Public License for more details.
|
|
17
17
|
|
|
18
18
|
You should have received a copy of the GNU General Public License
|
|
19
|
-
along with
|
|
19
|
+
along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
20
20
|
*********************************************************************-->
|
|
21
21
|
|
|
22
22
|
<!-- http://pimpmyxslt.com/articles/entity-tricks-part2/ -->
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
<?xml version='1.0'?>
|
|
2
2
|
|
|
3
3
|
<!--********************************************************************
|
|
4
|
-
Copyright 2018
|
|
4
|
+
Copyright (C) 2018-2026 Robert A. Beezer
|
|
5
5
|
|
|
6
|
-
This file is part of
|
|
6
|
+
This file is part of PreTeXt.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
PreTeXt is free software: you can redistribute it and/or modify
|
|
9
9
|
it under the terms of the GNU General Public License as published by
|
|
10
10
|
the Free Software Foundation, either version 2 or version 3 of the
|
|
11
11
|
License (at your option).
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
PreTeXt is distributed in the hope that it will be useful,
|
|
14
14
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
15
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
16
|
GNU General Public License for more details.
|
|
17
17
|
|
|
18
18
|
You should have received a copy of the GNU General Public License
|
|
19
|
-
along with
|
|
19
|
+
along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
20
20
|
*********************************************************************-->
|
|
21
21
|
|
|
22
22
|
<!-- http://pimpmyxslt.com/articles/entity-tricks-part2/ -->
|
|
@@ -4,22 +4,22 @@
|
|
|
4
4
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
|
5
5
|
|
|
6
6
|
<!--********************************************************************
|
|
7
|
-
Copyright 2013
|
|
7
|
+
Copyright (C) 2013-2026 Robert A. Beezer
|
|
8
8
|
|
|
9
|
-
This file is part of
|
|
9
|
+
This file is part of PreTeXt.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
PreTeXt is free software: you can redistribute it and/or modify
|
|
12
12
|
it under the terms of the GNU General Public License as published by
|
|
13
13
|
the Free Software Foundation, either version 2 or version 3 of the
|
|
14
14
|
License (at your option).
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
PreTeXt is distributed in the hope that it will be useful,
|
|
17
17
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
18
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
19
|
GNU General Public License for more details.
|
|
20
20
|
|
|
21
21
|
You should have received a copy of the GNU General Public License
|
|
22
|
-
along with
|
|
22
|
+
along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
23
23
|
*********************************************************************-->
|
|
24
24
|
|
|
25
25
|
<!-- This file contains unit-related abbreviations, such as 'kilo' => 'k' -->
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
2
2
|
|
|
3
3
|
<!-- ********************************************************************* -->
|
|
4
|
-
<!-- Copyright 2015-
|
|
4
|
+
<!-- Copyright (C) 2015-2026 -->
|
|
5
5
|
<!-- Robert A. Beezer, Michael Gage, Geoff Goehle, Alex Jordan -->
|
|
6
6
|
<!-- -->
|
|
7
7
|
<!-- This file is part of PreTeXt. -->
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
|
30
30
|
xmlns:xml="http://www.w3.org/XML/1998/namespace"
|
|
31
31
|
xmlns:exsl="http://exslt.org/common"
|
|
32
|
+
xmlns:pi="http://pretextbook.org/2020/pretext/internal"
|
|
32
33
|
extension-element-prefixes="exsl"
|
|
33
34
|
>
|
|
34
35
|
|
|
@@ -154,18 +155,20 @@
|
|
|
154
155
|
<xsl:value-of select="concat('/',$external-directory,@local)"/>
|
|
155
156
|
</xsl:template>
|
|
156
157
|
|
|
157
|
-
<!-- For copied problems move to the problem that was copied
|
|
158
|
-
<!--
|
|
159
|
-
<!--
|
|
160
|
-
<!--
|
|
161
|
-
<!--
|
|
162
|
-
<!--
|
|
163
|
-
|
|
164
|
-
|
|
158
|
+
<!-- For copied problems move to the problem that was copied. -->
|
|
159
|
+
<!-- This stylesheet imports pretext-assembly.xsl and assembles -->
|
|
160
|
+
<!-- from source, so the attribute it sees is the tree stamp -->
|
|
161
|
+
<!-- "@pi:copied-from", holding the @xml:id the author aimed -->
|
|
162
|
+
<!-- @copy at. The plain "@copied-from" of the representations -->
|
|
163
|
+
<!-- file is a different thing with a different value, the -->
|
|
164
|
+
<!-- assembly identifier of the copied problem's exercise, and -->
|
|
165
|
+
<!-- it never reaches this stylesheet. -->
|
|
166
|
+
<xsl:template match="webwork[@pi:copied-from]" mode="relative-filename">
|
|
167
|
+
<xsl:variable name="copied-from" select="@pi:copied-from"/>
|
|
165
168
|
<xsl:apply-templates select="$document-root//webwork[@xml:id=$copied-from]" mode="relative-filename"/>
|
|
166
169
|
</xsl:template>
|
|
167
|
-
<xsl:template match="webwork[@copied-from]" mode="filename">
|
|
168
|
-
<xsl:variable name="copied-from" select="@copied-from"/>
|
|
170
|
+
<xsl:template match="webwork[@pi:copied-from]" mode="filename">
|
|
171
|
+
<xsl:variable name="copied-from" select="@pi:copied-from"/>
|
|
169
172
|
<xsl:apply-templates select="$document-root//webwork[@xml:id=$copied-from]" mode="filename"/>
|
|
170
173
|
</xsl:template>
|
|
171
174
|
|
|
@@ -203,7 +206,7 @@
|
|
|
203
206
|
</xsl:template>
|
|
204
207
|
|
|
205
208
|
<!-- We don't write a new file for a copied webwork exercise -->
|
|
206
|
-
<xsl:template match="webwork[@copied-from]" mode="write-file"/>
|
|
209
|
+
<xsl:template match="webwork[@pi:copied-from]" mode="write-file"/>
|
|
207
210
|
|
|
208
211
|
<!-- ################## -->
|
|
209
212
|
<!-- Chunking Def Files-->
|