@pretextbook/pretext-html 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/assets/preview-html.xsl +14 -0
- package/assets/upstream.json +1 -1
- package/assets/xsl/LICENSE-pretext +1 -1
- package/assets/xsl/README.md +43 -25
- package/assets/xsl/entities.ent +4 -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 +25 -25
- 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 +64 -1
- package/assets/xsl/pretext-basic-html.xsl +5 -5
- package/assets/xsl/pretext-braille-preprint.xsl +5 -5
- package/assets/xsl/pretext-common.xsl +104 -30
- package/assets/xsl/pretext-dynamic.xsl +1 -1
- package/assets/xsl/pretext-epub.xsl +90 -84
- package/assets/xsl/pretext-fo.xsl +1 -1
- package/assets/xsl/pretext-html.xsl +57 -34
- 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 +7 -5
- 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-runestone-fitb.xsl +18 -0
- package/assets/xsl/pretext-runestone-static.xsl +13 -1
- package/assets/xsl/pretext-runestone.xsl +34 -6
- 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 +104 -36
- 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/play-button/README.md +3 -1
- package/assets/xsl/support/webpack_static_imports.xml +19 -0
- package/assets/xsl/tests/README.md +20 -1
- 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 +27 -6
- 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-DZsyZERX.js → cli-D0m0Ha1j.js} +358 -196
- package/dist/cli.js +2 -2
- package/dist/index.browser.d.ts +3 -0
- package/dist/index.browser.js +477 -322
- package/dist/index.d.ts +3 -0
- package/dist/index.js +25 -21
- package/dist/knowls.d.ts +43 -0
- package/dist/renderer.d.ts +26 -0
- package/package.json +1 -1
- package/assets/xsl/pretext-smc.xsl +0 -492
|
@@ -78,29 +78,20 @@
|
|
|
78
78
|
</xsl:variable>
|
|
79
79
|
<xsl:variable name="mock-UUID">mock-123456789-0-987654321</xsl:variable>
|
|
80
80
|
|
|
81
|
-
<!--
|
|
82
|
-
<!--
|
|
83
|
-
<!--
|
|
84
|
-
<!--
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
<xsl:when test="$root/book/part">3</xsl:when>
|
|
90
|
-
<xsl:when test="$root/book">2</xsl:when>
|
|
91
|
-
<!-- break "article" into "section" -->
|
|
92
|
-
<xsl:when test="$root/article/section">1</xsl:when>
|
|
93
|
-
<!-- otherwise, no real divisions -->
|
|
94
|
-
<xsl:when test="$root/article">0</xsl:when>
|
|
95
|
-
</xsl:choose>
|
|
96
|
-
</xsl:variable>
|
|
97
|
-
|
|
98
|
-
<!-- Force level 2 as the top level heading for chunks -->
|
|
99
|
-
<!-- by overrideing this template than calling the original -->
|
|
81
|
+
<!-- The level a document's structure implies, with no publisher -->
|
|
82
|
+
<!-- choice consulted: a reader is served by files that are neither -->
|
|
83
|
+
<!-- so large that a reading system labors over one nor so numerous -->
|
|
84
|
+
<!-- that it labors over the set. See "chunking-level-warnings". -->
|
|
85
|
+
<xsl:variable name="chunk-level" select="$chunk-level-default"/>
|
|
86
|
+
|
|
87
|
+
<!-- Force level 2 as the top level heading for chunks -->
|
|
88
|
+
<!-- by overriding this variable rather than the original. -->
|
|
100
89
|
<xsl:variable name="chunk-heading-level" select="2"/>
|
|
101
90
|
|
|
102
|
-
<!--
|
|
103
|
-
|
|
91
|
+
<!-- The navigation document lists every file of the spine, so its -->
|
|
92
|
+
<!-- depth is the chunking level and there is nothing left for a -->
|
|
93
|
+
<!-- table of contents level to say. See "chunking-level-warnings". -->
|
|
94
|
+
<xsl:variable name="toc-level" select="number(0)"/>
|
|
104
95
|
|
|
105
96
|
<!-- XHTML files as output -->
|
|
106
97
|
<xsl:variable name="file-extension" select="'.xhtml'" />
|
|
@@ -213,12 +204,25 @@
|
|
|
213
204
|
<xsl:apply-templates select="$original" mode="parameter-deprecation-warnings"/>
|
|
214
205
|
<!-- Following should use $root or $document-root as defined -->
|
|
215
206
|
<!-- by the "assembly" template. Checked 2020-07-16. -->
|
|
207
|
+
<xsl:call-template name="chunking-level-warnings"/>
|
|
216
208
|
<xsl:call-template name="setup" />
|
|
217
209
|
<xsl:apply-templates select="$root"/>
|
|
218
210
|
<xsl:call-template name="package-document" />
|
|
219
211
|
<xsl:call-template name="packaging-info"/>
|
|
220
212
|
</xsl:template>
|
|
221
213
|
|
|
214
|
+
<!-- Two publisher choices under "common" do not reach this -->
|
|
215
|
+
<!-- conversion, and an author who set one deserves to hear so -->
|
|
216
|
+
<!-- rather than wonder why the output never changed. -->
|
|
217
|
+
<xsl:template name="chunking-level-warnings">
|
|
218
|
+
<xsl:if test="$chunk-level-entered != ''">
|
|
219
|
+
<xsl:message>PTX:FALLBACK: the publisher file common/chunking/@level entry is being ignored for the conversion to EPUB, which always divides a document at the default level for its structure. The choice matters little here: a reading system presents the files as one continuous reading order, and the level only governs how large the files are. The default keeps them at a size reading systems handle well.</xsl:message>
|
|
220
|
+
</xsl:if>
|
|
221
|
+
<xsl:if test="$publication/common/tableofcontents/@level">
|
|
222
|
+
<xsl:message>PTX:FALLBACK: the publisher file common/tableofcontents/@level entry is being ignored for the conversion to EPUB, whose navigation lists every file of the document, leaving a reading system to provide its own control over how much of that to show at once.</xsl:message>
|
|
223
|
+
</xsl:if>
|
|
224
|
+
</xsl:template>
|
|
225
|
+
|
|
222
226
|
<!-- First, create the cover page and table of contents files, which are -->
|
|
223
227
|
<!-- necessary for every EPUB, even when the source has no "frontmatter" -->
|
|
224
228
|
<!-- We process structural nodes via chunking routine in xsl/mathbook-common.xsl -->
|
|
@@ -901,46 +905,11 @@
|
|
|
901
905
|
<nav epub:type="toc" id="toc">
|
|
902
906
|
<h2>Table of Contents</h2>
|
|
903
907
|
<ol>
|
|
904
|
-
<!--
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
<xsl:apply-templates select="." mode="containing-filename" />
|
|
910
|
-
</xsl:attribute>
|
|
911
|
-
<xsl:apply-templates select="." mode="title-simple" />
|
|
912
|
-
</xsl:element>
|
|
913
|
-
<xsl:apply-templates select="." mode="nav-companions"/>
|
|
914
|
-
</li>
|
|
915
|
-
</xsl:for-each>
|
|
916
|
-
<!-- following divisions identical for book v. article -->
|
|
917
|
-
<xsl:if test="$document-root/backmatter/appendix|$document-root/backmatter/solutions">
|
|
918
|
-
<li class="no-marker">
|
|
919
|
-
<span>Appendices</span>
|
|
920
|
-
<ol type="A">
|
|
921
|
-
<xsl:for-each select="$document-root/backmatter/appendix|$document-root/backmatter/solutions">
|
|
922
|
-
<li>
|
|
923
|
-
<xsl:element name="a">
|
|
924
|
-
<xsl:attribute name="href">
|
|
925
|
-
<xsl:apply-templates select="." mode="containing-filename" />
|
|
926
|
-
</xsl:attribute>
|
|
927
|
-
<xsl:apply-templates select="." mode="title-simple" />
|
|
928
|
-
</xsl:element>
|
|
929
|
-
</li>
|
|
930
|
-
</xsl:for-each>
|
|
931
|
-
</ol>
|
|
932
|
-
</li>
|
|
933
|
-
</xsl:if>
|
|
934
|
-
<xsl:for-each select="$document-root/backmatter/references|$document-root/backmatter/index">
|
|
935
|
-
<li class="no-marker">
|
|
936
|
-
<xsl:element name="a">
|
|
937
|
-
<xsl:attribute name="href">
|
|
938
|
-
<xsl:apply-templates select="." mode="containing-filename" />
|
|
939
|
-
</xsl:attribute>
|
|
940
|
-
<xsl:apply-templates select="." mode="title-simple" />
|
|
941
|
-
</xsl:element>
|
|
942
|
-
</li>
|
|
943
|
-
</xsl:for-each>
|
|
908
|
+
<!-- The whole document, so the navigation mirrors the spine: -->
|
|
909
|
+
<!-- every file of the reading order earns an entry, nested by -->
|
|
910
|
+
<!-- the divisions that contain it. A reading system offers no -->
|
|
911
|
+
<!-- other way in, so anything omitted here is unreachable. -->
|
|
912
|
+
<xsl:apply-templates select="$document-root" mode="nav-entry"/>
|
|
944
913
|
</ol>
|
|
945
914
|
</nav>
|
|
946
915
|
</body>
|
|
@@ -948,31 +917,68 @@
|
|
|
948
917
|
</exsl:document>
|
|
949
918
|
</xsl:template>
|
|
950
919
|
|
|
951
|
-
<!--
|
|
952
|
-
<!--
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
920
|
+
<!-- One "li" of the navigation document per file of the spine. -->
|
|
921
|
+
<!-- The test is "is-epub-page", the very template the manifest -->
|
|
922
|
+
<!-- and the spine consult, so the four cannot disagree. A -->
|
|
923
|
+
<!-- division that is not a file of its own ("book" and -->
|
|
924
|
+
<!-- "backmatter") contributes no entry, and its children rise -->
|
|
925
|
+
<!-- to take its place rather than becoming unreachable. -->
|
|
926
|
+
<xsl:template match="&STRUCTURAL;" mode="nav-entry">
|
|
927
|
+
<xsl:variable name="is-page">
|
|
928
|
+
<xsl:apply-templates select="." mode="is-epub-page"/>
|
|
929
|
+
</xsl:variable>
|
|
930
|
+
<xsl:choose>
|
|
931
|
+
<xsl:when test="$is-page = 'true'">
|
|
932
|
+
<li>
|
|
933
|
+
<xsl:element name="a">
|
|
934
|
+
<xsl:attribute name="href">
|
|
935
|
+
<xsl:apply-templates select="." mode="containing-filename"/>
|
|
936
|
+
</xsl:attribute>
|
|
937
|
+
<xsl:apply-templates select="." mode="title-simple"/>
|
|
938
|
+
</xsl:element>
|
|
939
|
+
<xsl:call-template name="nav-subentries"/>
|
|
940
|
+
</li>
|
|
941
|
+
</xsl:when>
|
|
942
|
+
<xsl:otherwise>
|
|
943
|
+
<xsl:apply-templates select="*" mode="nav-entry"/>
|
|
944
|
+
</xsl:otherwise>
|
|
945
|
+
</xsl:choose>
|
|
946
|
+
</xsl:template>
|
|
947
|
+
|
|
948
|
+
<!-- A division companion is a file exactly when it is a chunk, -->
|
|
949
|
+
<!-- the same test the manifest makes. It has no children that -->
|
|
950
|
+
<!-- could ever be files, so there is no recursion. -->
|
|
951
|
+
<xsl:template match="&DIVISION-COMPANION;" mode="nav-entry">
|
|
952
|
+
<xsl:variable name="chunk">
|
|
953
|
+
<xsl:apply-templates select="." mode="is-chunk"/>
|
|
958
954
|
</xsl:variable>
|
|
959
|
-
<xsl:if test="
|
|
955
|
+
<xsl:if test="$chunk = 'true'">
|
|
956
|
+
<li class="no-marker">
|
|
957
|
+
<xsl:element name="a">
|
|
958
|
+
<xsl:attribute name="href">
|
|
959
|
+
<xsl:apply-templates select="." mode="containing-filename"/>
|
|
960
|
+
</xsl:attribute>
|
|
961
|
+
<xsl:apply-templates select="." mode="division-companion-text"/>
|
|
962
|
+
</xsl:element>
|
|
963
|
+
</li>
|
|
964
|
+
</xsl:if>
|
|
965
|
+
</xsl:template>
|
|
966
|
+
|
|
967
|
+
<!-- Everything else is not a division, so it is not a file, so -->
|
|
968
|
+
<!-- it earns no entry. Without this the default template rule -->
|
|
969
|
+
<!-- would spill the text of paragraphs into the navigation. -->
|
|
970
|
+
<xsl:template match="*" mode="nav-entry"/>
|
|
971
|
+
|
|
972
|
+
<!-- The nested list of a division's own entries, built first so -->
|
|
973
|
+
<!-- that a division whose children are all inlined contributes -->
|
|
974
|
+
<!-- no empty "ol", which is invalid in a navigation document. -->
|
|
975
|
+
<xsl:template name="nav-subentries">
|
|
976
|
+
<xsl:variable name="subentries">
|
|
977
|
+
<xsl:apply-templates select="*" mode="nav-entry"/>
|
|
978
|
+
</xsl:variable>
|
|
979
|
+
<xsl:if test="exsl:node-set($subentries)/*">
|
|
960
980
|
<ol>
|
|
961
|
-
<xsl:
|
|
962
|
-
<xsl:variable name="chunk">
|
|
963
|
-
<xsl:apply-templates select="." mode="is-chunk"/>
|
|
964
|
-
</xsl:variable>
|
|
965
|
-
<xsl:if test="$chunk = 'true'">
|
|
966
|
-
<li class="no-marker">
|
|
967
|
-
<xsl:element name="a">
|
|
968
|
-
<xsl:attribute name="href">
|
|
969
|
-
<xsl:apply-templates select="." mode="containing-filename" />
|
|
970
|
-
</xsl:attribute>
|
|
971
|
-
<xsl:apply-templates select="." mode="division-companion-text" />
|
|
972
|
-
</xsl:element>
|
|
973
|
-
</li>
|
|
974
|
-
</xsl:if>
|
|
975
|
-
</xsl:for-each>
|
|
981
|
+
<xsl:copy-of select="$subentries"/>
|
|
976
982
|
</ol>
|
|
977
983
|
</xsl:if>
|
|
978
984
|
</xsl:template>
|
|
@@ -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/ -->
|
|
@@ -754,10 +754,10 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
754
754
|
<xsl:with-param name="heading-level" select="$next-level"/>
|
|
755
755
|
</xsl:apply-templates>
|
|
756
756
|
|
|
757
|
-
<!--
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
757
|
+
<!-- Groupwork submission items are not emitted here. They belong -->
|
|
758
|
+
<!-- above the Runestone progress indicator, which the various -->
|
|
759
|
+
<!-- "structural-division-inner-content" templates emit as their last -->
|
|
760
|
+
<!-- act, so each of those emits the submission items just before it. -->
|
|
761
761
|
|
|
762
762
|
<!-- Include permalink for the section as last child -->
|
|
763
763
|
<xsl:apply-templates select="." mode="permalink"/>
|
|
@@ -813,9 +813,8 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
813
813
|
<xsl:when test="$b-is-groupwork">
|
|
814
814
|
<!-- the actual list of exercises -->
|
|
815
815
|
<xsl:copy-of select="$the-exercises"/>
|
|
816
|
-
<!--
|
|
817
|
-
|
|
818
|
-
<!-- template (early and late in "section") -->
|
|
816
|
+
<!-- and the group selection and submission items -->
|
|
817
|
+
<xsl:apply-templates select="." mode="runestone-groupwork"/>
|
|
819
818
|
<!-- No progress indicator in this case -->
|
|
820
819
|
</xsl:when>
|
|
821
820
|
<!-- some extra wrapping for timed exercises -->
|
|
@@ -845,6 +844,13 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
845
844
|
<xsl:apply-templates select="*">
|
|
846
845
|
<xsl:with-param name="heading-level" select="$heading-level"/>
|
|
847
846
|
</xsl:apply-templates>
|
|
847
|
+
<!-- A "worksheet" electing group work arrives here, and its submission -->
|
|
848
|
+
<!-- items go above the progress indicator: Runestone attaches the "mark -->
|
|
849
|
+
<!-- as completed" control to that indicator, and a reader chooses their -->
|
|
850
|
+
<!-- group before declaring the page done, not after. -->
|
|
851
|
+
<xsl:if test="$b-host-runestone and (@groupwork = 'yes') and (self::worksheet or self::exercises) and (parent::chapter or parent::appendix)">
|
|
852
|
+
<xsl:apply-templates select="." mode="runestone-groupwork"/>
|
|
853
|
+
</xsl:if>
|
|
848
854
|
<!-- only at "section" level. only when building for a Runestone server -->
|
|
849
855
|
<xsl:apply-templates select="." mode="runestone-progress-indicator"/>
|
|
850
856
|
</xsl:template>
|
|
@@ -6920,7 +6926,9 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
6920
6926
|
<!-- 2. Author must ensure the versions are next to file employed -->
|
|
6921
6927
|
<!-- 3. Formatting and case of suffixes is author's choice -->
|
|
6922
6928
|
<!-- 4. Order in suffix list is respected in output -->
|
|
6923
|
-
<!-- 5. Per-image, with global spec in
|
|
6929
|
+
<!-- 5. Per-image, with global spec in the publication file -->
|
|
6930
|
+
<!-- ("/publication/html/images/archive"); the old location -->
|
|
6931
|
+
<!-- within "docinfo" is honored while the former is silent -->
|
|
6924
6932
|
<!-- -->
|
|
6925
6933
|
<!-- The originating image template knows/computes the filename, -->
|
|
6926
6934
|
<!-- so this template accepts the filename, sans period and -->
|
|
@@ -6942,28 +6950,42 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
6942
6950
|
<!-- last in list that contains the image wins -->
|
|
6943
6951
|
<!-- Documented heavily as first "mid-range" specification -->
|
|
6944
6952
|
<!-- A single @from puts us in mid-range mode -->
|
|
6945
|
-
<xsl:when test="$
|
|
6946
|
-
<!--
|
|
6947
|
-
<!-- so
|
|
6953
|
+
<xsl:when test="$image-archives[@from]">
|
|
6954
|
+
<!-- An "archive" node may live in the publication file, -->
|
|
6955
|
+
<!-- so the id() lookup for its @from must be evaluated -->
|
|
6956
|
+
<!-- with the context switched into the (assembled) -->
|
|
6957
|
+
<!-- source, where the present "image" lives. -->
|
|
6948
6958
|
<xsl:variable name="the-image" select="." />
|
|
6949
|
-
<!--
|
|
6950
|
-
<!--
|
|
6951
|
-
<!-- Form two subtrees of all desendant nodes, rooted at -->
|
|
6959
|
+
<!-- Test each "archive" with @from, in document order: -->
|
|
6960
|
+
<!-- Form two subtrees of all descendant nodes, rooted at -->
|
|
6952
6961
|
<!-- (1) the image node -->
|
|
6953
6962
|
<!-- (2) the node pointed to by @from -->
|
|
6954
6963
|
<!-- The pipe forms a union of the nodes in the subtrees -->
|
|
6955
6964
|
<!-- "image" is on the subtree @from iff union is no larger -->
|
|
6956
|
-
|
|
6957
|
-
|
|
6965
|
+
<!-- Each containing "archive" records its formats, so the -->
|
|
6966
|
+
<!-- effective (last) one can be read off the collection. -->
|
|
6967
|
+
<xsl:variable name="containing-archives-rtf">
|
|
6968
|
+
<xsl:for-each select="$image-archives[@from]">
|
|
6969
|
+
<xsl:variable name="the-formats" select="string(.)"/>
|
|
6970
|
+
<xsl:variable name="the-from" select="string(@from)"/>
|
|
6971
|
+
<xsl:for-each select="$the-image">
|
|
6972
|
+
<xsl:if test="count($the-image/descendant-or-self::node()|id($the-from)/descendant-or-self::node())=count(id($the-from)/descendant-or-self::node())">
|
|
6973
|
+
<pi:archive-formats>
|
|
6974
|
+
<xsl:value-of select="$the-formats"/>
|
|
6975
|
+
</pi:archive-formats>
|
|
6976
|
+
</xsl:if>
|
|
6977
|
+
</xsl:for-each>
|
|
6978
|
+
</xsl:for-each>
|
|
6979
|
+
</xsl:variable>
|
|
6958
6980
|
<!-- We mimic XSL and the last applicable "archive" is effective -->
|
|
6959
6981
|
<!-- This way, big subtrees go first, included subtrees refine -->
|
|
6960
6982
|
<!-- @from can be an empty string and turn off the behavior -->
|
|
6961
6983
|
<!-- We grab the content of the last "archive" to be the formats -->
|
|
6962
|
-
<xsl:value-of select="$containing-archives[last()]
|
|
6984
|
+
<xsl:value-of select="exsl:node-set($containing-archives-rtf)/pi:archive-formats[last()]" />
|
|
6963
6985
|
</xsl:when>
|
|
6964
6986
|
<!-- global, presumes one only, ignores subtree versions -->
|
|
6965
|
-
<xsl:when test="$
|
|
6966
|
-
<xsl:value-of select="normalize-space($
|
|
6987
|
+
<xsl:when test="$image-archives[not(@from)]">
|
|
6988
|
+
<xsl:value-of select="normalize-space($image-archives)" />
|
|
6967
6989
|
</xsl:when>
|
|
6968
6990
|
<!-- nothing begets nothing -->
|
|
6969
6991
|
<xsl:otherwise />
|
|
@@ -11341,6 +11363,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
11341
11363
|
<xsl:value-of select="$external-directory"/>
|
|
11342
11364
|
<xsl:value-of select="@source"/>
|
|
11343
11365
|
</xsl:attribute>
|
|
11366
|
+
<xsl:apply-templates select="." mode="html-id-attribute"/>
|
|
11344
11367
|
<xsl:if test="@qname != ''">
|
|
11345
11368
|
<xsl:attribute name="data-qname">
|
|
11346
11369
|
<xsl:value-of select="@qname" />
|
|
@@ -11805,7 +11828,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
11805
11828
|
</xsl:call-template>
|
|
11806
11829
|
</xsl:if>
|
|
11807
11830
|
<!-- image (og,twitter) - if its URL can be constructed -->
|
|
11808
|
-
<xsl:if test="$b-has-baseurl and $
|
|
11831
|
+
<xsl:if test="$b-has-baseurl and $b-brandlogo">
|
|
11809
11832
|
<xsl:call-template name="social-meta-element">
|
|
11810
11833
|
<xsl:with-param name="og" select="true()"/>
|
|
11811
11834
|
<xsl:with-param name="twitter" select="true()"/>
|
|
@@ -11815,7 +11838,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
11815
11838
|
<!-- empty when not using managed directories -->
|
|
11816
11839
|
<xsl:value-of select="$baseurl"/>
|
|
11817
11840
|
<xsl:value-of select="$external-directory"/>
|
|
11818
|
-
<xsl:value-of select="$
|
|
11841
|
+
<xsl:value-of select="$brandlogo-source"/>
|
|
11819
11842
|
</xsl:with-param>
|
|
11820
11843
|
</xsl:call-template>
|
|
11821
11844
|
<!-- alttext -->
|
|
@@ -11866,7 +11889,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
11866
11889
|
<xsl:with-param name="property" select="'card'"/>
|
|
11867
11890
|
<xsl:with-param name="content">
|
|
11868
11891
|
<xsl:choose>
|
|
11869
|
-
<xsl:when test="$b-has-baseurl and $
|
|
11892
|
+
<xsl:when test="$b-has-baseurl and $b-brandlogo">
|
|
11870
11893
|
<xsl:text>summary_large_image</xsl:text>
|
|
11871
11894
|
</xsl:when>
|
|
11872
11895
|
<xsl:otherwise>
|
|
@@ -14545,22 +14568,22 @@ TODO:
|
|
|
14545
14568
|
<!-- Brand Logo -->
|
|
14546
14569
|
<!-- Place image in masthead -->
|
|
14547
14570
|
<!-- We either create a link with an image, or just an image. -->
|
|
14548
|
-
<!-- NB: This template does nothing unless
|
|
14549
|
-
<!--
|
|
14550
|
-
<!--
|
|
14571
|
+
<!-- NB: This template does nothing unless a brand logo has -->
|
|
14572
|
+
<!-- been elected (publication file, or the deprecated -->
|
|
14573
|
+
<!-- "docinfo" location), which requires its @source. -->
|
|
14551
14574
|
<xsl:template name="brand-logo">
|
|
14552
|
-
<xsl:if test="$
|
|
14575
|
+
<xsl:if test="$b-brandlogo">
|
|
14553
14576
|
<xsl:variable name="location">
|
|
14554
14577
|
<!-- empty when not using managed directories -->
|
|
14555
14578
|
<xsl:value-of select="$external-directory"/>
|
|
14556
|
-
<xsl:value-of select="$
|
|
14579
|
+
<xsl:value-of select="$brandlogo-source"/>
|
|
14557
14580
|
</xsl:variable>
|
|
14558
14581
|
|
|
14559
14582
|
<xsl:choose>
|
|
14560
|
-
<xsl:when test="$
|
|
14583
|
+
<xsl:when test="not($brandlogo-url = '')">
|
|
14561
14584
|
<a id="logo-link" class="logo-link" target="_blank" >
|
|
14562
14585
|
<xsl:attribute name="href">
|
|
14563
|
-
<xsl:value-of select="$
|
|
14586
|
+
<xsl:value-of select="$brandlogo-url"/>
|
|
14564
14587
|
</xsl:attribute>
|
|
14565
14588
|
<img src="{$location}" alt="Logo image"/>
|
|
14566
14589
|
</a>
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
<?xml version='1.0'?> <!-- As XML file -->
|
|
2
2
|
|
|
3
3
|
<!--********************************************************************
|
|
4
|
-
Copyright 2015
|
|
4
|
+
Copyright (C) 2015-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/ -->
|
|
@@ -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>
|
|
@@ -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, -->
|
|
@@ -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
|