@pretextbook/pretext-html 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +104 -4
- package/assets/preview-html.xsl +230 -230
- package/assets/upstream.json +7 -7
- package/assets/xsl/entities.ent +154 -154
- package/assets/xsl/extract-asymptote.xsl +68 -68
- package/assets/xsl/extract-biblio-csl.xsl +327 -327
- package/assets/xsl/extract-datafile.xsl +71 -71
- package/assets/xsl/extract-dynamic.xsl +139 -139
- package/assets/xsl/extract-identity.xsl +136 -136
- package/assets/xsl/extract-interactive.xsl +81 -81
- package/assets/xsl/extract-latex-image.xsl +118 -118
- package/assets/xsl/extract-mermaid.xsl +58 -58
- package/assets/xsl/extract-mom.xsl +63 -63
- package/assets/xsl/extract-pg.xsl +2897 -2897
- package/assets/xsl/extract-prefigure.xsl +157 -157
- package/assets/xsl/extract-qrcode.xsl +100 -100
- package/assets/xsl/extract-runestone-page-template.xsl +139 -139
- package/assets/xsl/extract-sageplot.xsl +166 -166
- package/assets/xsl/extract-stack.xsl +56 -56
- package/assets/xsl/extract-trace.xsl +134 -134
- package/assets/xsl/extract-youtube.xsl +63 -63
- package/assets/xsl/html-symbols.xsl +3344 -3344
- package/assets/xsl/latex/pretext-latex-AIM.xsl +56 -56
- package/assets/xsl/latex/pretext-latex-CLP.xsl +148 -148
- package/assets/xsl/latex/pretext-latex-chaos.xsl +317 -317
- package/assets/xsl/latex/pretext-latex-dyslexic-font.xsl +76 -76
- package/assets/xsl/latex/pretext-latex-guide.xsl +104 -104
- package/assets/xsl/latex/pretext-latex-texstyle.xsl +862 -862
- package/assets/xsl/localizations/af-ZA.xml +276 -276
- package/assets/xsl/localizations/bg-BG.xml +276 -276
- package/assets/xsl/localizations/ca-ES.xml +285 -285
- package/assets/xsl/localizations/cs-CZ.xml +280 -280
- package/assets/xsl/localizations/de-DE.xml +281 -281
- package/assets/xsl/localizations/en-US.xml +427 -427
- package/assets/xsl/localizations/es-ES.xml +287 -287
- package/assets/xsl/localizations/fi-FI.xml +275 -275
- package/assets/xsl/localizations/fr-CA.xml +276 -276
- package/assets/xsl/localizations/fr-FR.xml +280 -280
- package/assets/xsl/localizations/hu-HU.xml +280 -280
- package/assets/xsl/localizations/it-IT.xml +276 -276
- package/assets/xsl/localizations/ku-CKB.xml +275 -275
- package/assets/xsl/localizations/localizations.xml +48 -48
- package/assets/xsl/localizations/nl-NL.xml +275 -275
- package/assets/xsl/localizations/pt-BR.xml +288 -288
- package/assets/xsl/localizations/pt-PT.xml +292 -292
- package/assets/xsl/localizations/zh-HANS.xml +269 -269
- package/assets/xsl/pretext-assembly.xsl +4795 -4795
- package/assets/xsl/pretext-basic-html.xsl +86 -86
- package/assets/xsl/pretext-beamer.xsl +662 -662
- package/assets/xsl/pretext-braille-preprint.xsl +2249 -2249
- package/assets/xsl/pretext-common.xsl +12018 -12018
- package/assets/xsl/pretext-dynamic.xsl +65 -65
- package/assets/xsl/pretext-epub.xsl +1483 -1483
- package/assets/xsl/pretext-fo.xsl +4593 -4593
- package/assets/xsl/pretext-html.xsl +14791 -14791
- package/assets/xsl/pretext-json-manifest.xsl +150 -150
- package/assets/xsl/pretext-jupyter.xsl +868 -868
- package/assets/xsl/pretext-latex-classic.xsl +952 -952
- package/assets/xsl/pretext-latex-common.xsl +11563 -11563
- package/assets/xsl/pretext-latex.xsl +47 -47
- package/assets/xsl/pretext-litprog.xsl +105 -105
- package/assets/xsl/pretext-merge.xsl +41 -41
- package/assets/xsl/pretext-numbers.xsl +875 -875
- package/assets/xsl/pretext-revealjs.xsl +522 -522
- package/assets/xsl/pretext-runestone-fitb.xsl +1233 -1233
- package/assets/xsl/pretext-runestone-static.xsl +1438 -1438
- package/assets/xsl/pretext-runestone.xsl +3083 -3083
- package/assets/xsl/pretext-sage-doctest.xsl +289 -289
- package/assets/xsl/pretext-smc.xsl +492 -492
- package/assets/xsl/pretext-solution-manual-latex.xsl +323 -323
- package/assets/xsl/pretext-text-utilities.xsl +1217 -1217
- package/assets/xsl/pretext-text.xsl +392 -392
- package/assets/xsl/pretext-units.xsl +195 -195
- package/assets/xsl/pretext-view-source.xsl +157 -157
- package/assets/xsl/pretext-ww-problem-sets.xsl +391 -391
- package/assets/xsl/publisher-variables.xsl +4756 -4756
- package/assets/xsl/support/extract-math.xsl +256 -256
- package/assets/xsl/support/package-math.xsl +141 -141
- package/assets/xsl/support/play-button/play-button.svg +3 -3
- package/assets/xsl/support/pretext-pg-macros.xsl +110 -110
- package/assets/xsl/support/webpack_static_imports.xml +14 -14
- package/assets/xsl/tests/null.xml +3 -3
- package/assets/xsl/tests/pretext-text-utilities-test.xsl +333 -333
- package/assets/xsl/utilities/author-report.xsl +107 -107
- package/assets/xsl/utilities/deprecate-autoname.sed +18 -18
- package/assets/xsl/utilities/deprecate-index.sed +33 -33
- package/assets/xsl/utilities/fix-deprecations.xsl +663 -663
- package/assets/xsl/utilities/pretext-enhanced-source.xsl +112 -112
- package/assets/xsl/utilities/report-publisher-variables.xsl +162 -162
- package/assets/xsl/xml-to-json.xsl +326 -326
- package/assets/xsl/xml-to-string.xsl +328 -328
- package/assets/xsl-bundle.json +1 -0
- package/dist/{cli-C6tfAVvi.js → cli-B2LiKunq.js} +268 -233
- package/dist/cli.js +1 -1
- package/dist/host.browser.d.ts +29 -0
- package/dist/host.d.ts +41 -0
- package/dist/index.browser.d.ts +29 -0
- package/dist/index.browser.js +650 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +16 -8
- package/dist/internal/posix-path.d.ts +59 -0
- package/dist/mounts.d.ts +18 -0
- package/dist/renderer.d.ts +14 -1
- package/dist/theme.d.ts +68 -0
- package/dist/theme.js +93 -0
- package/package.json +22 -4
|
@@ -1,112 +1,112 @@
|
|
|
1
|
-
<?xml version='1.0'?>
|
|
2
|
-
|
|
3
|
-
<!--********************************************************************
|
|
4
|
-
Copyright 2020 Robert A. Beezer
|
|
5
|
-
|
|
6
|
-
This file is part of PreTeXt.
|
|
7
|
-
|
|
8
|
-
PreTeXt is free software: you can redistribute it and/or modify
|
|
9
|
-
it under the terms of the GNU General Public License as published by
|
|
10
|
-
the Free Software Foundation, either version 2 or version 3 of the
|
|
11
|
-
License (at your option).
|
|
12
|
-
|
|
13
|
-
PreTeXt is distributed in the hope that it will be useful,
|
|
14
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
-
GNU General Public License for more details.
|
|
17
|
-
|
|
18
|
-
You should have received a copy of the GNU General Public License
|
|
19
|
-
along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
-
*********************************************************************-->
|
|
21
|
-
|
|
22
|
-
<xsl:stylesheet
|
|
23
|
-
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
|
24
|
-
xmlns:xml="http://www.w3.org/XML/1998/namespace"
|
|
25
|
-
>
|
|
26
|
-
|
|
27
|
-
<!-- This stylesheet should behave, without any errors, without -->
|
|
28
|
-
<!-- importing the "pretext-common.xsl" stylesheet. Typically, -->
|
|
29
|
-
<!-- in other uses of the two stylesheets above, we import -->
|
|
30
|
-
<!-- "pretext-common.xsl" as well, which will include many -->
|
|
31
|
-
<!-- "strip-space" directives, which will impact the assembled -->
|
|
32
|
-
<!-- source (without any real harm, though, just different). -->
|
|
33
|
-
<!-- In other words, the two (symbiotic) stylesheets used here -->
|
|
34
|
-
<!-- should remain independent of the -common stylesheet. -->
|
|
35
|
-
<!-- -->
|
|
36
|
-
<!-- The "publisher-variables.xsl" and "pretext-assembly.xsl" -->
|
|
37
|
-
<!-- stylesheets are symbiotic, and should be imported -->
|
|
38
|
-
<!-- simultaneously. Assembly will change the source in various -->
|
|
39
|
-
<!-- ways, while some defaults for publisher variables will depend -->
|
|
40
|
-
<!-- on source. The default variables should depend on gross -->
|
|
41
|
-
<!-- structure and adjustments should be to smaller portions of -->
|
|
42
|
-
<!-- the source, but we don't take any chances. So, note in -->
|
|
43
|
-
<!-- "assembly" that an intermediate tree is defined as a -->
|
|
44
|
-
<!-- variable, which is then used in defining some variables, -->
|
|
45
|
-
<!-- based on assembled source. Conversely, certain variables, -->
|
|
46
|
-
<!-- such as locations of customizations or private solutions, -->
|
|
47
|
-
<!-- are needed early in assembly, while other variables, such -->
|
|
48
|
-
<!-- as options for numbering, are needed for later enhancements -->
|
|
49
|
-
<!-- to the source. If new code results in undefine, or -->
|
|
50
|
-
<!-- recursively defined, variables, this discussion may be -->
|
|
51
|
-
<!-- relevant. (This is repeated verbatim in the other -->
|
|
52
|
-
<!-- stylesheet). -->
|
|
53
|
-
|
|
54
|
-
<xsl:import href="../publisher-variables.xsl"/>
|
|
55
|
-
<xsl:import href="../pretext-assembly.xsl"/>
|
|
56
|
-
|
|
57
|
-
<!-- Every conversion that imports "pretext-assembly.xsl" -->
|
|
58
|
-
<!-- also imports "pretext-common.xsl". So we do likewise here, -->
|
|
59
|
-
<!-- which brings in whitespace control via "strip-space" and -->
|
|
60
|
-
<!-- templates (like "type-name") that assembly-time processing -->
|
|
61
|
-
<!-- may depend on. -->
|
|
62
|
-
|
|
63
|
-
<xsl:import href="../pretext-common.xsl"/>
|
|
64
|
-
|
|
65
|
-
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
|
|
66
|
-
|
|
67
|
-
<!-- The "pretext-assembly.xsl" stylesheet is parameterized by a -->
|
|
68
|
-
<!-- *variable* for what types of exercises to create - mostly -->
|
|
69
|
-
<!-- static, but for HTML, interactive (dynamic). In this way -->
|
|
70
|
-
<!-- importing stylesheets can set and override the variable as -->
|
|
71
|
-
<!-- necessary, but it is a bit harder to set via string parameters-->
|
|
72
|
-
<!-- in the usual ways. But for this utility, we want to run both -->
|
|
73
|
-
<!-- modes. So we *do* have a parameter here, and it just becomes -->
|
|
74
|
-
<!-- the value of the variable, as just described. Default if not -->
|
|
75
|
-
<!-- set is "static", the alternative is "dynamic". -->
|
|
76
|
-
|
|
77
|
-
<xsl:param name="debug.assembly.exercise" select="'static'"/>
|
|
78
|
-
<xsl:variable name="exercise-style">
|
|
79
|
-
<xsl:value-of select="$debug.assembly.exercise"/>
|
|
80
|
-
</xsl:variable>
|
|
81
|
-
|
|
82
|
-
<!-- ############## -->
|
|
83
|
-
<!-- Entry Template -->
|
|
84
|
-
<!-- ############## -->
|
|
85
|
-
|
|
86
|
-
<!-- $root points to intermediate enhanced source created -->
|
|
87
|
-
<!-- in the "pretext-assembly.xsl" stylesheet, so study that -->
|
|
88
|
-
<!-- stylesheet to understand what it is being displayed. -->
|
|
89
|
-
<!-- This stylesheet will be affected by whatever parameters -->
|
|
90
|
-
<!-- and auxiliary files that the assembly stylesheet reacts to. -->
|
|
91
|
-
|
|
92
|
-
<xsl:template match="/">
|
|
93
|
-
<xsl:choose>
|
|
94
|
-
<xsl:when test="$b-version-only">
|
|
95
|
-
<xsl:apply-templates select="$version" mode="showme"/>
|
|
96
|
-
</xsl:when>
|
|
97
|
-
<xsl:when test="$b-assembly-id-only">
|
|
98
|
-
<xsl:apply-templates select="$assembly-label" mode="showme"/>
|
|
99
|
-
</xsl:when>
|
|
100
|
-
<xsl:otherwise>
|
|
101
|
-
<xsl:apply-templates select="$root" mode="showme"/>
|
|
102
|
-
</xsl:otherwise>
|
|
103
|
-
</xsl:choose>
|
|
104
|
-
</xsl:template>
|
|
105
|
-
|
|
106
|
-
<xsl:template match="node()|@*" mode="showme">
|
|
107
|
-
<xsl:copy>
|
|
108
|
-
<xsl:apply-templates select="node()|@*" mode="showme"/>
|
|
109
|
-
</xsl:copy>
|
|
110
|
-
</xsl:template>
|
|
111
|
-
|
|
112
|
-
</xsl:stylesheet>
|
|
1
|
+
<?xml version='1.0'?>
|
|
2
|
+
|
|
3
|
+
<!--********************************************************************
|
|
4
|
+
Copyright 2020 Robert A. Beezer
|
|
5
|
+
|
|
6
|
+
This file is part of PreTeXt.
|
|
7
|
+
|
|
8
|
+
PreTeXt is free software: you can redistribute it and/or modify
|
|
9
|
+
it under the terms of the GNU General Public License as published by
|
|
10
|
+
the Free Software Foundation, either version 2 or version 3 of the
|
|
11
|
+
License (at your option).
|
|
12
|
+
|
|
13
|
+
PreTeXt is distributed in the hope that it will be useful,
|
|
14
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
GNU General Public License for more details.
|
|
17
|
+
|
|
18
|
+
You should have received a copy of the GNU General Public License
|
|
19
|
+
along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*********************************************************************-->
|
|
21
|
+
|
|
22
|
+
<xsl:stylesheet
|
|
23
|
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
|
24
|
+
xmlns:xml="http://www.w3.org/XML/1998/namespace"
|
|
25
|
+
>
|
|
26
|
+
|
|
27
|
+
<!-- This stylesheet should behave, without any errors, without -->
|
|
28
|
+
<!-- importing the "pretext-common.xsl" stylesheet. Typically, -->
|
|
29
|
+
<!-- in other uses of the two stylesheets above, we import -->
|
|
30
|
+
<!-- "pretext-common.xsl" as well, which will include many -->
|
|
31
|
+
<!-- "strip-space" directives, which will impact the assembled -->
|
|
32
|
+
<!-- source (without any real harm, though, just different). -->
|
|
33
|
+
<!-- In other words, the two (symbiotic) stylesheets used here -->
|
|
34
|
+
<!-- should remain independent of the -common stylesheet. -->
|
|
35
|
+
<!-- -->
|
|
36
|
+
<!-- The "publisher-variables.xsl" and "pretext-assembly.xsl" -->
|
|
37
|
+
<!-- stylesheets are symbiotic, and should be imported -->
|
|
38
|
+
<!-- simultaneously. Assembly will change the source in various -->
|
|
39
|
+
<!-- ways, while some defaults for publisher variables will depend -->
|
|
40
|
+
<!-- on source. The default variables should depend on gross -->
|
|
41
|
+
<!-- structure and adjustments should be to smaller portions of -->
|
|
42
|
+
<!-- the source, but we don't take any chances. So, note in -->
|
|
43
|
+
<!-- "assembly" that an intermediate tree is defined as a -->
|
|
44
|
+
<!-- variable, which is then used in defining some variables, -->
|
|
45
|
+
<!-- based on assembled source. Conversely, certain variables, -->
|
|
46
|
+
<!-- such as locations of customizations or private solutions, -->
|
|
47
|
+
<!-- are needed early in assembly, while other variables, such -->
|
|
48
|
+
<!-- as options for numbering, are needed for later enhancements -->
|
|
49
|
+
<!-- to the source. If new code results in undefine, or -->
|
|
50
|
+
<!-- recursively defined, variables, this discussion may be -->
|
|
51
|
+
<!-- relevant. (This is repeated verbatim in the other -->
|
|
52
|
+
<!-- stylesheet). -->
|
|
53
|
+
|
|
54
|
+
<xsl:import href="../publisher-variables.xsl"/>
|
|
55
|
+
<xsl:import href="../pretext-assembly.xsl"/>
|
|
56
|
+
|
|
57
|
+
<!-- Every conversion that imports "pretext-assembly.xsl" -->
|
|
58
|
+
<!-- also imports "pretext-common.xsl". So we do likewise here, -->
|
|
59
|
+
<!-- which brings in whitespace control via "strip-space" and -->
|
|
60
|
+
<!-- templates (like "type-name") that assembly-time processing -->
|
|
61
|
+
<!-- may depend on. -->
|
|
62
|
+
|
|
63
|
+
<xsl:import href="../pretext-common.xsl"/>
|
|
64
|
+
|
|
65
|
+
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
|
|
66
|
+
|
|
67
|
+
<!-- The "pretext-assembly.xsl" stylesheet is parameterized by a -->
|
|
68
|
+
<!-- *variable* for what types of exercises to create - mostly -->
|
|
69
|
+
<!-- static, but for HTML, interactive (dynamic). In this way -->
|
|
70
|
+
<!-- importing stylesheets can set and override the variable as -->
|
|
71
|
+
<!-- necessary, but it is a bit harder to set via string parameters-->
|
|
72
|
+
<!-- in the usual ways. But for this utility, we want to run both -->
|
|
73
|
+
<!-- modes. So we *do* have a parameter here, and it just becomes -->
|
|
74
|
+
<!-- the value of the variable, as just described. Default if not -->
|
|
75
|
+
<!-- set is "static", the alternative is "dynamic". -->
|
|
76
|
+
|
|
77
|
+
<xsl:param name="debug.assembly.exercise" select="'static'"/>
|
|
78
|
+
<xsl:variable name="exercise-style">
|
|
79
|
+
<xsl:value-of select="$debug.assembly.exercise"/>
|
|
80
|
+
</xsl:variable>
|
|
81
|
+
|
|
82
|
+
<!-- ############## -->
|
|
83
|
+
<!-- Entry Template -->
|
|
84
|
+
<!-- ############## -->
|
|
85
|
+
|
|
86
|
+
<!-- $root points to intermediate enhanced source created -->
|
|
87
|
+
<!-- in the "pretext-assembly.xsl" stylesheet, so study that -->
|
|
88
|
+
<!-- stylesheet to understand what it is being displayed. -->
|
|
89
|
+
<!-- This stylesheet will be affected by whatever parameters -->
|
|
90
|
+
<!-- and auxiliary files that the assembly stylesheet reacts to. -->
|
|
91
|
+
|
|
92
|
+
<xsl:template match="/">
|
|
93
|
+
<xsl:choose>
|
|
94
|
+
<xsl:when test="$b-version-only">
|
|
95
|
+
<xsl:apply-templates select="$version" mode="showme"/>
|
|
96
|
+
</xsl:when>
|
|
97
|
+
<xsl:when test="$b-assembly-id-only">
|
|
98
|
+
<xsl:apply-templates select="$assembly-label" mode="showme"/>
|
|
99
|
+
</xsl:when>
|
|
100
|
+
<xsl:otherwise>
|
|
101
|
+
<xsl:apply-templates select="$root" mode="showme"/>
|
|
102
|
+
</xsl:otherwise>
|
|
103
|
+
</xsl:choose>
|
|
104
|
+
</xsl:template>
|
|
105
|
+
|
|
106
|
+
<xsl:template match="node()|@*" mode="showme">
|
|
107
|
+
<xsl:copy>
|
|
108
|
+
<xsl:apply-templates select="node()|@*" mode="showme"/>
|
|
109
|
+
</xsl:copy>
|
|
110
|
+
</xsl:template>
|
|
111
|
+
|
|
112
|
+
</xsl:stylesheet>
|
|
@@ -1,162 +1,162 @@
|
|
|
1
|
-
<?xml version='1.0'?> <!-- As XML file -->
|
|
2
|
-
|
|
3
|
-
<!--********************************************************************
|
|
4
|
-
Copyright 2013 Robert A. Beezer
|
|
5
|
-
|
|
6
|
-
This file is part of MathBook XML.
|
|
7
|
-
|
|
8
|
-
MathBook XML 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
|
-
MathBook XML 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 MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
-
*********************************************************************-->
|
|
21
|
-
|
|
22
|
-
<!-- http://pimpmyxslt.com/articles/entity-tricks-part2/ -->
|
|
23
|
-
<!DOCTYPE xsl:stylesheet [
|
|
24
|
-
<!ENTITY % entities SYSTEM "../entities.ent">
|
|
25
|
-
%entities;
|
|
26
|
-
]>
|
|
27
|
-
|
|
28
|
-
<!-- Identify as a stylesheet -->
|
|
29
|
-
<!-- We choose to not include a default namespace -->
|
|
30
|
-
<!-- (in particular http://www.w3.org/1999/xhtml), -->
|
|
31
|
-
<!-- even if this complicates adding namespaces onto -->
|
|
32
|
-
<!-- derivatives, such as HTML destined for EPUB output -->
|
|
33
|
-
<!-- xmlns="http://www.w3.org/1999/xhtml" -->
|
|
34
|
-
<!-- -->
|
|
35
|
-
<!-- NB: -->
|
|
36
|
-
<!-- "xsl" is necessary to identify XSL functionality -->
|
|
37
|
-
<!-- "xml" is automatic, hence redundant -->
|
|
38
|
-
<!-- "svg" is necessary to for Asymptote 3D images -->
|
|
39
|
-
<!-- "pi" is meant to mark private PreTeXt markup -->
|
|
40
|
-
<!-- "exsl" namespaces enable extension functions -->
|
|
41
|
-
<!-- -->
|
|
42
|
-
<!-- Excluding result prefixes keeps them from bleeding -->
|
|
43
|
-
<!-- into output unnecessarily -->
|
|
44
|
-
<xsl:stylesheet
|
|
45
|
-
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
|
46
|
-
>
|
|
47
|
-
|
|
48
|
-
<!-- DEBUGGING -->
|
|
49
|
-
<!-- xsltproc -o crap.txt -stringparam publisher ~/mathbook/mathbook/examples/sample-article/publication.xml /home/rob/mathbook/mathbook/xsl/utilities/report-publisher-variables.xsl ~/mathbook/mathbook/examples/sample-article/sample-article.xml -->
|
|
50
|
-
|
|
51
|
-
<!-- Standard conversion groundwork -->
|
|
52
|
-
<xsl:import href="../publisher-variables.xsl"/>
|
|
53
|
-
<xsl:import href="../pretext-assembly.xsl"/>
|
|
54
|
-
|
|
55
|
-
<!-- Intend output for a text file -->
|
|
56
|
-
<xsl:output method="text" encoding="UTF-8"/>
|
|
57
|
-
|
|
58
|
-
<!-- IMPORTANT: to report the value of a (computed) publisher variable, -->
|
|
59
|
-
<!-- two related routines are involved. For a variable not previously -->
|
|
60
|
-
<!-- supported, a developer must take action to implement a report. The -->
|
|
61
|
-
<!-- XSL in the "utilities/report-publisher-variable.xsl" stylesheet must -->
|
|
62
|
-
<!-- include the report of a value, which will be captured in a temporary -->
|
|
63
|
-
<!-- file to be read by the Python routine "get_publisher_variable()". -->
|
|
64
|
-
|
|
65
|
-
<xsl:template match="/">
|
|
66
|
-
<!-- 2024-06-20 Testing-->
|
|
67
|
-
<xsl:text>generated-directory-source</xsl:text>
|
|
68
|
-
<xsl:text> </xsl:text>
|
|
69
|
-
<xsl:value-of select="$generated-directory-source"/>
|
|
70
|
-
<xsl:text>
</xsl:text>
|
|
71
|
-
<!-- 2024-06-20 Testing-->
|
|
72
|
-
<xsl:text>external-directory-source</xsl:text>
|
|
73
|
-
<xsl:text> </xsl:text>
|
|
74
|
-
<xsl:value-of select="$external-directory-source"/>
|
|
75
|
-
<xsl:text>
</xsl:text>
|
|
76
|
-
<!-- 2024-06-26 Mermaid theme -->
|
|
77
|
-
<xsl:text>mermaid-theme</xsl:text>
|
|
78
|
-
<xsl:text> </xsl:text>
|
|
79
|
-
<xsl:value-of select="$mermaid-theme"/>
|
|
80
|
-
<xsl:text>
</xsl:text>
|
|
81
|
-
<!-- 2024-07-07 QR code image -->
|
|
82
|
-
<xsl:text>qrcode-image</xsl:text>
|
|
83
|
-
<xsl:text> </xsl:text>
|
|
84
|
-
<xsl:value-of select="$qrcode-image"/>
|
|
85
|
-
<xsl:text>
</xsl:text>
|
|
86
|
-
<!-- 2024-07-21 theme for html build -->
|
|
87
|
-
<xsl:text>html-theme-name</xsl:text>
|
|
88
|
-
<xsl:text> </xsl:text>
|
|
89
|
-
<xsl:value-of select="$html-theme-name"/>
|
|
90
|
-
<xsl:text>
</xsl:text>
|
|
91
|
-
<xsl:text>html-theme-options</xsl:text>
|
|
92
|
-
<xsl:text> </xsl:text>
|
|
93
|
-
<xsl:value-of select="$html-theme-options"/>
|
|
94
|
-
<xsl:text>
</xsl:text>
|
|
95
|
-
<!-- 2024-10-04 LaTeX style xsl -->
|
|
96
|
-
<xsl:text>latex-style</xsl:text>
|
|
97
|
-
<xsl:text> </xsl:text>
|
|
98
|
-
<xsl:value-of select="$latex-style"/>
|
|
99
|
-
<xsl:text>
</xsl:text>
|
|
100
|
-
<!-- 2025-02-25 journal name -->
|
|
101
|
-
<xsl:text>journal-name</xsl:text>
|
|
102
|
-
<xsl:text> </xsl:text>
|
|
103
|
-
<xsl:value-of select="$journal-name"/>
|
|
104
|
-
<xsl:text>
</xsl:text>
|
|
105
|
-
<!-- 2025-03-10 portable html switch -->
|
|
106
|
-
<xsl:text>portable-html</xsl:text>
|
|
107
|
-
<xsl:text> </xsl:text>
|
|
108
|
-
<xsl:value-of select="$portable-html"/>
|
|
109
|
-
<xsl:text>
</xsl:text>
|
|
110
|
-
<!-- 2026-06-30 local/cdn resources -->
|
|
111
|
-
<xsl:text>b-cdn-resources</xsl:text>
|
|
112
|
-
<xsl:text> </xsl:text>
|
|
113
|
-
<xsl:value-of select="$b-cdn-resources"/>
|
|
114
|
-
<xsl:text>
</xsl:text>
|
|
115
|
-
<!-- 2025-05-10 CSL style indicator -->
|
|
116
|
-
<xsl:text>b-using-csl-styles</xsl:text>
|
|
117
|
-
<xsl:text> </xsl:text>
|
|
118
|
-
<xsl:value-of select="$b-using-csl-styles"/>
|
|
119
|
-
<xsl:text>
</xsl:text>
|
|
120
|
-
<!-- 2025-05-10 CSL style filename -->
|
|
121
|
-
<xsl:text>csl-style-file</xsl:text>
|
|
122
|
-
<xsl:text> </xsl:text>
|
|
123
|
-
<xsl:value-of select="$csl-style-file"/>
|
|
124
|
-
<xsl:text>
</xsl:text>
|
|
125
|
-
<!-- 2025-06-26 Mermaid layout engine -->
|
|
126
|
-
<xsl:text>mermaid-layout-engine</xsl:text>
|
|
127
|
-
<xsl:text> </xsl:text>
|
|
128
|
-
<xsl:value-of select="$mermaid-layout-engine"/>
|
|
129
|
-
<xsl:text>
</xsl:text>
|
|
130
|
-
<!-- 2025-09-18 Server to call for STACK question rendering -->
|
|
131
|
-
<xsl:text>stack-server</xsl:text>
|
|
132
|
-
<xsl:text> </xsl:text>
|
|
133
|
-
<xsl:value-of select="$stack-server"/>
|
|
134
|
-
<xsl:text>
</xsl:text>
|
|
135
|
-
<!-- 2026-02-16 Base URL that interactives -->
|
|
136
|
-
<xsl:text>baseurl</xsl:text>
|
|
137
|
-
<xsl:text> </xsl:text>
|
|
138
|
-
<xsl:value-of select="$baseurl"/>
|
|
139
|
-
<xsl:text>
</xsl:text>
|
|
140
|
-
<!-- 2026-06-25 platform host for html -->
|
|
141
|
-
<xsl:text>host-platform</xsl:text>
|
|
142
|
-
<xsl:text> </xsl:text>
|
|
143
|
-
<xsl:value-of select="$host-platform"/>
|
|
144
|
-
<xsl:text>
</xsl:text>
|
|
145
|
-
<!-- -->
|
|
146
|
-
|
|
147
|
-
<!--
|
|
148
|
-
Boilerplate to support a new variable
|
|
149
|
-
Please use this style, as above
|
|
150
|
-
(remove "X" to format comments properly)
|
|
151
|
-
|
|
152
|
-
<!-X- YYY-MM-DD Purpose-X->
|
|
153
|
-
<xsl:text>[[var-name-here]]</xsl:text>
|
|
154
|
-
<xsl:text> </xsl:text>
|
|
155
|
-
<xsl:value-of select="$[[var-name-here-keep-prefix-$]]"/>
|
|
156
|
-
<xsl:text>
</xsl:text>
|
|
157
|
-
<!-X- -X->
|
|
158
|
-
-->
|
|
159
|
-
|
|
160
|
-
</xsl:template>
|
|
161
|
-
|
|
162
|
-
</xsl:stylesheet>
|
|
1
|
+
<?xml version='1.0'?> <!-- As XML file -->
|
|
2
|
+
|
|
3
|
+
<!--********************************************************************
|
|
4
|
+
Copyright 2013 Robert A. Beezer
|
|
5
|
+
|
|
6
|
+
This file is part of MathBook XML.
|
|
7
|
+
|
|
8
|
+
MathBook XML 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
|
+
MathBook XML 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 MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*********************************************************************-->
|
|
21
|
+
|
|
22
|
+
<!-- http://pimpmyxslt.com/articles/entity-tricks-part2/ -->
|
|
23
|
+
<!DOCTYPE xsl:stylesheet [
|
|
24
|
+
<!ENTITY % entities SYSTEM "../entities.ent">
|
|
25
|
+
%entities;
|
|
26
|
+
]>
|
|
27
|
+
|
|
28
|
+
<!-- Identify as a stylesheet -->
|
|
29
|
+
<!-- We choose to not include a default namespace -->
|
|
30
|
+
<!-- (in particular http://www.w3.org/1999/xhtml), -->
|
|
31
|
+
<!-- even if this complicates adding namespaces onto -->
|
|
32
|
+
<!-- derivatives, such as HTML destined for EPUB output -->
|
|
33
|
+
<!-- xmlns="http://www.w3.org/1999/xhtml" -->
|
|
34
|
+
<!-- -->
|
|
35
|
+
<!-- NB: -->
|
|
36
|
+
<!-- "xsl" is necessary to identify XSL functionality -->
|
|
37
|
+
<!-- "xml" is automatic, hence redundant -->
|
|
38
|
+
<!-- "svg" is necessary to for Asymptote 3D images -->
|
|
39
|
+
<!-- "pi" is meant to mark private PreTeXt markup -->
|
|
40
|
+
<!-- "exsl" namespaces enable extension functions -->
|
|
41
|
+
<!-- -->
|
|
42
|
+
<!-- Excluding result prefixes keeps them from bleeding -->
|
|
43
|
+
<!-- into output unnecessarily -->
|
|
44
|
+
<xsl:stylesheet
|
|
45
|
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
|
46
|
+
>
|
|
47
|
+
|
|
48
|
+
<!-- DEBUGGING -->
|
|
49
|
+
<!-- xsltproc -o crap.txt -stringparam publisher ~/mathbook/mathbook/examples/sample-article/publication.xml /home/rob/mathbook/mathbook/xsl/utilities/report-publisher-variables.xsl ~/mathbook/mathbook/examples/sample-article/sample-article.xml -->
|
|
50
|
+
|
|
51
|
+
<!-- Standard conversion groundwork -->
|
|
52
|
+
<xsl:import href="../publisher-variables.xsl"/>
|
|
53
|
+
<xsl:import href="../pretext-assembly.xsl"/>
|
|
54
|
+
|
|
55
|
+
<!-- Intend output for a text file -->
|
|
56
|
+
<xsl:output method="text" encoding="UTF-8"/>
|
|
57
|
+
|
|
58
|
+
<!-- IMPORTANT: to report the value of a (computed) publisher variable, -->
|
|
59
|
+
<!-- two related routines are involved. For a variable not previously -->
|
|
60
|
+
<!-- supported, a developer must take action to implement a report. The -->
|
|
61
|
+
<!-- XSL in the "utilities/report-publisher-variable.xsl" stylesheet must -->
|
|
62
|
+
<!-- include the report of a value, which will be captured in a temporary -->
|
|
63
|
+
<!-- file to be read by the Python routine "get_publisher_variable()". -->
|
|
64
|
+
|
|
65
|
+
<xsl:template match="/">
|
|
66
|
+
<!-- 2024-06-20 Testing-->
|
|
67
|
+
<xsl:text>generated-directory-source</xsl:text>
|
|
68
|
+
<xsl:text> </xsl:text>
|
|
69
|
+
<xsl:value-of select="$generated-directory-source"/>
|
|
70
|
+
<xsl:text>
</xsl:text>
|
|
71
|
+
<!-- 2024-06-20 Testing-->
|
|
72
|
+
<xsl:text>external-directory-source</xsl:text>
|
|
73
|
+
<xsl:text> </xsl:text>
|
|
74
|
+
<xsl:value-of select="$external-directory-source"/>
|
|
75
|
+
<xsl:text>
</xsl:text>
|
|
76
|
+
<!-- 2024-06-26 Mermaid theme -->
|
|
77
|
+
<xsl:text>mermaid-theme</xsl:text>
|
|
78
|
+
<xsl:text> </xsl:text>
|
|
79
|
+
<xsl:value-of select="$mermaid-theme"/>
|
|
80
|
+
<xsl:text>
</xsl:text>
|
|
81
|
+
<!-- 2024-07-07 QR code image -->
|
|
82
|
+
<xsl:text>qrcode-image</xsl:text>
|
|
83
|
+
<xsl:text> </xsl:text>
|
|
84
|
+
<xsl:value-of select="$qrcode-image"/>
|
|
85
|
+
<xsl:text>
</xsl:text>
|
|
86
|
+
<!-- 2024-07-21 theme for html build -->
|
|
87
|
+
<xsl:text>html-theme-name</xsl:text>
|
|
88
|
+
<xsl:text> </xsl:text>
|
|
89
|
+
<xsl:value-of select="$html-theme-name"/>
|
|
90
|
+
<xsl:text>
</xsl:text>
|
|
91
|
+
<xsl:text>html-theme-options</xsl:text>
|
|
92
|
+
<xsl:text> </xsl:text>
|
|
93
|
+
<xsl:value-of select="$html-theme-options"/>
|
|
94
|
+
<xsl:text>
</xsl:text>
|
|
95
|
+
<!-- 2024-10-04 LaTeX style xsl -->
|
|
96
|
+
<xsl:text>latex-style</xsl:text>
|
|
97
|
+
<xsl:text> </xsl:text>
|
|
98
|
+
<xsl:value-of select="$latex-style"/>
|
|
99
|
+
<xsl:text>
</xsl:text>
|
|
100
|
+
<!-- 2025-02-25 journal name -->
|
|
101
|
+
<xsl:text>journal-name</xsl:text>
|
|
102
|
+
<xsl:text> </xsl:text>
|
|
103
|
+
<xsl:value-of select="$journal-name"/>
|
|
104
|
+
<xsl:text>
</xsl:text>
|
|
105
|
+
<!-- 2025-03-10 portable html switch -->
|
|
106
|
+
<xsl:text>portable-html</xsl:text>
|
|
107
|
+
<xsl:text> </xsl:text>
|
|
108
|
+
<xsl:value-of select="$portable-html"/>
|
|
109
|
+
<xsl:text>
</xsl:text>
|
|
110
|
+
<!-- 2026-06-30 local/cdn resources -->
|
|
111
|
+
<xsl:text>b-cdn-resources</xsl:text>
|
|
112
|
+
<xsl:text> </xsl:text>
|
|
113
|
+
<xsl:value-of select="$b-cdn-resources"/>
|
|
114
|
+
<xsl:text>
</xsl:text>
|
|
115
|
+
<!-- 2025-05-10 CSL style indicator -->
|
|
116
|
+
<xsl:text>b-using-csl-styles</xsl:text>
|
|
117
|
+
<xsl:text> </xsl:text>
|
|
118
|
+
<xsl:value-of select="$b-using-csl-styles"/>
|
|
119
|
+
<xsl:text>
</xsl:text>
|
|
120
|
+
<!-- 2025-05-10 CSL style filename -->
|
|
121
|
+
<xsl:text>csl-style-file</xsl:text>
|
|
122
|
+
<xsl:text> </xsl:text>
|
|
123
|
+
<xsl:value-of select="$csl-style-file"/>
|
|
124
|
+
<xsl:text>
</xsl:text>
|
|
125
|
+
<!-- 2025-06-26 Mermaid layout engine -->
|
|
126
|
+
<xsl:text>mermaid-layout-engine</xsl:text>
|
|
127
|
+
<xsl:text> </xsl:text>
|
|
128
|
+
<xsl:value-of select="$mermaid-layout-engine"/>
|
|
129
|
+
<xsl:text>
</xsl:text>
|
|
130
|
+
<!-- 2025-09-18 Server to call for STACK question rendering -->
|
|
131
|
+
<xsl:text>stack-server</xsl:text>
|
|
132
|
+
<xsl:text> </xsl:text>
|
|
133
|
+
<xsl:value-of select="$stack-server"/>
|
|
134
|
+
<xsl:text>
</xsl:text>
|
|
135
|
+
<!-- 2026-02-16 Base URL that interactives -->
|
|
136
|
+
<xsl:text>baseurl</xsl:text>
|
|
137
|
+
<xsl:text> </xsl:text>
|
|
138
|
+
<xsl:value-of select="$baseurl"/>
|
|
139
|
+
<xsl:text>
</xsl:text>
|
|
140
|
+
<!-- 2026-06-25 platform host for html -->
|
|
141
|
+
<xsl:text>host-platform</xsl:text>
|
|
142
|
+
<xsl:text> </xsl:text>
|
|
143
|
+
<xsl:value-of select="$host-platform"/>
|
|
144
|
+
<xsl:text>
</xsl:text>
|
|
145
|
+
<!-- -->
|
|
146
|
+
|
|
147
|
+
<!--
|
|
148
|
+
Boilerplate to support a new variable
|
|
149
|
+
Please use this style, as above
|
|
150
|
+
(remove "X" to format comments properly)
|
|
151
|
+
|
|
152
|
+
<!-X- YYY-MM-DD Purpose-X->
|
|
153
|
+
<xsl:text>[[var-name-here]]</xsl:text>
|
|
154
|
+
<xsl:text> </xsl:text>
|
|
155
|
+
<xsl:value-of select="$[[var-name-here-keep-prefix-$]]"/>
|
|
156
|
+
<xsl:text>
</xsl:text>
|
|
157
|
+
<!-X- -X->
|
|
158
|
+
-->
|
|
159
|
+
|
|
160
|
+
</xsl:template>
|
|
161
|
+
|
|
162
|
+
</xsl:stylesheet>
|