@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,522 +1,522 @@
|
|
|
1
|
-
<?xml version='1.0'?>
|
|
2
|
-
|
|
3
|
-
<!--********************************************************************
|
|
4
|
-
Copyright 2019 Andrew Rechnitzer, Steven Clontz, 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
|
-
<!-- http://pimpmyxslt.com/articles/entity-tricks-part2/ -->
|
|
23
|
-
<!DOCTYPE xsl:stylesheet [
|
|
24
|
-
<!ENTITY % entities SYSTEM "entities.ent">
|
|
25
|
-
%entities;
|
|
26
|
-
]>
|
|
27
|
-
|
|
28
|
-
<!-- "pi" necessary to trap "visual" URLs automatically being -->
|
|
29
|
-
<!-- added by "assembly" for with-content "url" elements -->
|
|
30
|
-
<xsl:stylesheet
|
|
31
|
-
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
|
32
|
-
xmlns:xml="http://www.w3.org/XML/1998/namespace"
|
|
33
|
-
xmlns:pi="http://pretextbook.org/2020/pretext/internal"
|
|
34
|
-
xmlns:exsl="http://exslt.org/common"
|
|
35
|
-
xmlns:date="http://exslt.org/dates-and-times"
|
|
36
|
-
xmlns:str="http://exslt.org/strings"
|
|
37
|
-
extension-element-prefixes="exsl date str"
|
|
38
|
-
>
|
|
39
|
-
|
|
40
|
-
<!-- Necessary to get some HTML constructions, -->
|
|
41
|
-
<!-- but want to be sure to override the entry -->
|
|
42
|
-
<!-- template to avoid chunking, etc. -->
|
|
43
|
-
<!-- The pretext-assembly stylesheet is employed, -->
|
|
44
|
-
<!-- so be sure to use the right trees in the -->
|
|
45
|
-
<!-- entry template -->
|
|
46
|
-
<xsl:import href="pretext-html.xsl" />
|
|
47
|
-
|
|
48
|
-
<!-- Disable clipboardable -->
|
|
49
|
-
<xsl:template name="insert-clipboardable-class"/>
|
|
50
|
-
|
|
51
|
-
<!-- Used to identify build target in templates shared with plain -->
|
|
52
|
-
<!-- HTML conversion (preferably avoid using this). -->
|
|
53
|
-
<xsl:variable name="b-reveal-build" select="true()" />
|
|
54
|
-
|
|
55
|
-
<!-- Reveal.js output is one monolithic page, so heading levels are -->
|
|
56
|
-
<!-- threaded, not chunked. The slideshow title (h1) and subtitle -->
|
|
57
|
-
<!-- (h2) are fixed. A "section" is always level 2 (sections never -->
|
|
58
|
-
<!-- nest in a slideshow), so a "slide" title is level 3 when there -->
|
|
59
|
-
<!-- are sections and level 2 when there are none; slide content -->
|
|
60
|
-
<!-- begins one level deeper. -->
|
|
61
|
-
<xsl:variable name="b-reveal-has-sections" select="boolean($root/slideshow/section)"/>
|
|
62
|
-
<xsl:variable name="reveal-slide-heading-level">
|
|
63
|
-
<xsl:choose>
|
|
64
|
-
<xsl:when test="$b-reveal-has-sections">
|
|
65
|
-
<xsl:text>3</xsl:text>
|
|
66
|
-
</xsl:when>
|
|
67
|
-
<xsl:otherwise>
|
|
68
|
-
<xsl:text>2</xsl:text>
|
|
69
|
-
</xsl:otherwise>
|
|
70
|
-
</xsl:choose>
|
|
71
|
-
</xsl:variable>
|
|
72
|
-
|
|
73
|
-
<!-- HTML5 format -->
|
|
74
|
-
<xsl:output method="html" indent="yes" encoding="UTF-8" doctype-system="about:legacy-compat"/>
|
|
75
|
-
|
|
76
|
-
<!-- Publisher Switches -->
|
|
77
|
-
<!-- Various configuration options are set in the publisher file, -->
|
|
78
|
-
<!-- which is analyzed by its own stylesheet, which is imported in -->
|
|
79
|
-
<!-- the process of importing the pretext-html.xsl stylesheet. -->
|
|
80
|
-
|
|
81
|
-
<!-- ################ -->
|
|
82
|
-
<!-- # Entry Template -->
|
|
83
|
-
<!-- ################ -->
|
|
84
|
-
|
|
85
|
-
<!-- We override the entry template, so as to avoid the "chunking" -->
|
|
86
|
-
<!-- procedure, since we are going to *always* produce one monolithic -->
|
|
87
|
-
<!-- HTML file as the output/slideshow -->
|
|
88
|
-
<xsl:template match="/">
|
|
89
|
-
<xsl:call-template name="reveal-warnings"/>
|
|
90
|
-
<xsl:apply-templates select="$original" mode="generic-warnings"/>
|
|
91
|
-
<xsl:apply-templates select="$original" mode="element-deprecation-warnings"/>
|
|
92
|
-
<xsl:apply-templates select="$original" mode="parameter-deprecation-warnings"/>
|
|
93
|
-
<xsl:apply-templates select="$root"/>
|
|
94
|
-
</xsl:template>
|
|
95
|
-
|
|
96
|
-
<xsl:template match="/pretext">
|
|
97
|
-
<xsl:apply-templates select="slideshow" />
|
|
98
|
-
</xsl:template>
|
|
99
|
-
|
|
100
|
-
<!-- Kill creation of the index page from the -html -->
|
|
101
|
-
<!-- conversion (we just build one monolithic page) -->
|
|
102
|
-
<xsl:variable name="html-index-page" select="/.."/>
|
|
103
|
-
|
|
104
|
-
<!-- Kill knowl-ing of various environments -->
|
|
105
|
-
<xsl:template match="&THEOREM-LIKE;|&PROOF-LIKE;|&DEFINITION-LIKE;|&EXAMPLE-LIKE;|&PROJECT-LIKE;|task|&FIGURE-LIKE;|&REMARK-LIKE;|&GOAL-LIKE;|exercise" mode="is-hidden">
|
|
106
|
-
<xsl:text>no</xsl:text>
|
|
107
|
-
</xsl:template>
|
|
108
|
-
|
|
109
|
-
<!-- The HTML conversion computes a global "universal" Table of -->
|
|
110
|
-
<!-- Contents for the sidebar. Then later, for each page it sees -->
|
|
111
|
-
<!-- some customization. So we reset the variable here, and that -->
|
|
112
|
-
<!-- also means the work done in the "toc-items" template never -->
|
|
113
|
-
<!-- occurs. (And even better, doing the work was exposing that -->
|
|
114
|
-
<!-- the "level" template wasn't working right for a "slideshow".) -->
|
|
115
|
-
<xsl:variable name="toc-cache-rtf" select="''"/>
|
|
116
|
-
|
|
117
|
-
<!-- Write the infrastructure for a page -->
|
|
118
|
-
<xsl:template match="slideshow">
|
|
119
|
-
<xsl:call-template name="converter-blurb-html" />
|
|
120
|
-
<html>
|
|
121
|
-
<head>
|
|
122
|
-
<title>
|
|
123
|
-
<xsl:apply-templates select="." mode="title-simple" />
|
|
124
|
-
</title>
|
|
125
|
-
|
|
126
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=yes"></meta>
|
|
127
|
-
|
|
128
|
-
<xsl:call-template name="sagecell-code" />
|
|
129
|
-
<xsl:apply-templates select="." mode="sagecell" />
|
|
130
|
-
<xsl:call-template name="syntax-highlight"/>
|
|
131
|
-
|
|
132
|
-
<!-- load reveal.js resources; w/ v 4.1.2 -->
|
|
133
|
-
<!-- these seem to be *always* minified -->
|
|
134
|
-
<link href="{$reveal-root}/reset.css" rel="stylesheet"></link>
|
|
135
|
-
<link href="{$reveal-root}/reveal.css" rel="stylesheet"></link>
|
|
136
|
-
<link href="{$reveal-root}/theme/{$reveal-theme}.css" rel="stylesheet"></link>
|
|
137
|
-
<script src="{$reveal-root}/reveal.js"></script>
|
|
138
|
-
<script src="{$reveal-root}/plugin/math/math.js"></script>
|
|
139
|
-
|
|
140
|
-
<link href="_static/pretext/css/pretext-reveal.css" rel="stylesheet"></link>
|
|
141
|
-
<style>
|
|
142
|
-
</style>
|
|
143
|
-
<xsl:call-template name="diagcess-header"/>
|
|
144
|
-
|
|
145
|
-
<!-- custom-css, if specified, should be last -->
|
|
146
|
-
<xsl:if test="not($reveal-custom-css = '')">
|
|
147
|
-
<xsl:variable name="csses" select="str:tokenize($reveal-custom-css, ', ')"/>
|
|
148
|
-
<xsl:for-each select="$csses">
|
|
149
|
-
<link rel="stylesheet" type="text/css">
|
|
150
|
-
<xsl:attribute name="href">
|
|
151
|
-
<xsl:value-of select="." />
|
|
152
|
-
</xsl:attribute>
|
|
153
|
-
</link>
|
|
154
|
-
</xsl:for-each>
|
|
155
|
-
</xsl:if>
|
|
156
|
-
</head>
|
|
157
|
-
|
|
158
|
-
<body>
|
|
159
|
-
<div class="reveal ptx-content">
|
|
160
|
-
<!-- For mathematics/MathJax, must be located -->
|
|
161
|
-
<!-- within div.reveal to be effective -->
|
|
162
|
-
<xsl:apply-templates select="." mode="latex-macros"/>
|
|
163
|
-
<div class="slides">
|
|
164
|
-
<xsl:apply-templates select="frontmatter"/>
|
|
165
|
-
<xsl:apply-templates select="section|slide"/>
|
|
166
|
-
</div>
|
|
167
|
-
</div>
|
|
168
|
-
<xsl:call-template name="diagcess-footer"/>
|
|
169
|
-
</body>
|
|
170
|
-
|
|
171
|
-
<script>
|
|
172
|
-
<xsl:text>
</xsl:text>
|
|
173
|
-
<xsl:text>Reveal.initialize({
</xsl:text>
|
|
174
|
-
<xsl:text> controls: </xsl:text>
|
|
175
|
-
<xsl:choose>
|
|
176
|
-
<xsl:when test="$b-reveal-control-display">
|
|
177
|
-
<xsl:text>true</xsl:text>
|
|
178
|
-
</xsl:when>
|
|
179
|
-
<xsl:otherwise>
|
|
180
|
-
<xsl:text>false</xsl:text>
|
|
181
|
-
</xsl:otherwise>
|
|
182
|
-
</xsl:choose>
|
|
183
|
-
<xsl:text>,
</xsl:text>
|
|
184
|
-
<xsl:text> controlsTutorial: </xsl:text>
|
|
185
|
-
<xsl:choose>
|
|
186
|
-
<xsl:when test="$b-reveal-control-tutorial">
|
|
187
|
-
<xsl:text>true</xsl:text>
|
|
188
|
-
</xsl:when>
|
|
189
|
-
<xsl:otherwise>
|
|
190
|
-
<xsl:text>false</xsl:text>
|
|
191
|
-
</xsl:otherwise>
|
|
192
|
-
</xsl:choose>
|
|
193
|
-
<xsl:text>,
</xsl:text>
|
|
194
|
-
<xsl:text> controlsLayout: '</xsl:text>
|
|
195
|
-
<xsl:value-of select="$reveal-control-layout"/>
|
|
196
|
-
<xsl:text>',
</xsl:text>
|
|
197
|
-
<xsl:text> controlsBackArrows: '</xsl:text>
|
|
198
|
-
<xsl:value-of select="$reveal-control-backarrow"/>
|
|
199
|
-
<xsl:text>',
</xsl:text>
|
|
200
|
-
<xsl:text> navigationMode: '</xsl:text>
|
|
201
|
-
<xsl:value-of select="$reveal-navigation-mode"/>
|
|
202
|
-
<xsl:text>',
</xsl:text>
|
|
203
|
-
<xsl:text> progress: false,
</xsl:text>
|
|
204
|
-
<xsl:text> center: false,
</xsl:text>
|
|
205
|
-
<xsl:text> hash: true,
</xsl:text>
|
|
206
|
-
<xsl:text> transition: 'fade',
</xsl:text>
|
|
207
|
-
<xsl:text> width: "100%",
</xsl:text>
|
|
208
|
-
<xsl:text> height: "100%",
</xsl:text>
|
|
209
|
-
<xsl:text> margin: "0.025",
</xsl:text>
|
|
210
|
-
<!-- Explicitly enable AMS-style inline \(...\), -->
|
|
211
|
-
<!-- and explicitly disable TeX-style inline $...$ -->
|
|
212
|
-
<!-- The main HTML conversion does not do anything -->
|
|
213
|
-
<!-- special for display math, so we disable any such -->
|
|
214
|
-
<!-- markup, since we use environments exclusively. -->
|
|
215
|
-
<!-- N.B. default HTML adds a "zero-width" space into -->
|
|
216
|
-
<!-- a \( authored in a non-math context. -->
|
|
217
|
-
<!-- N.B. This may need to be changed for MathJax 3 -->
|
|
218
|
-
|
|
219
|
-
<!-- Suggested by https://revealjs.com/math/, 2021-09-19 -->
|
|
220
|
-
<xsl:text> math: {
</xsl:text>
|
|
221
|
-
<xsl:text> mathjax: 'https://cdn.jsdelivr.net/gh/mathjax/mathjax@2.7.8/MathJax.js',
</xsl:text>
|
|
222
|
-
<xsl:text> config: 'TeX-AMS_HTML-full',
</xsl:text>
|
|
223
|
-
<xsl:text> // other options are passed into MathJax.Hub.Config()
</xsl:text>
|
|
224
|
-
<xsl:text> tex2jax: {
</xsl:text>
|
|
225
|
-
<xsl:text> inlineMath: [['\\(','\\)']],
</xsl:text>
|
|
226
|
-
<xsl:text> displayMath: [],
</xsl:text>
|
|
227
|
-
<xsl:text> }
</xsl:text>
|
|
228
|
-
<xsl:text> },
</xsl:text>
|
|
229
|
-
<xsl:text> plugins: [ RevealMath ]
</xsl:text>
|
|
230
|
-
<xsl:text>});
</xsl:text>
|
|
231
|
-
</script>
|
|
232
|
-
</html>
|
|
233
|
-
</xsl:template>
|
|
234
|
-
|
|
235
|
-
<!-- A "section" contains multiple "slide", which we process, -->
|
|
236
|
-
<!-- but first we make a special slide announcing the "section" -->
|
|
237
|
-
<!-- With reveal.js navigationMode set to "default" or "grid" -->
|
|
238
|
-
<!-- we organize title slides as the "horizontal" (or major) -->
|
|
239
|
-
<!-- slides, with the slides within a section as the "vertical" -->
|
|
240
|
-
<!-- (or minor) slides. But if the navigationMode is "linear" -->
|
|
241
|
-
<!-- we do not even create this two-deep organization at all, -->
|
|
242
|
-
<!-- in part because we think the linear mode is buggy for -->
|
|
243
|
-
<!-- the last vertical set. -->
|
|
244
|
-
<xsl:template match="section">
|
|
245
|
-
<xsl:choose>
|
|
246
|
-
<xsl:when test="($reveal-navigation-mode = 'default') or ($reveal-navigation-mode = 'grid')">
|
|
247
|
-
<section>
|
|
248
|
-
<section>
|
|
249
|
-
<h2>
|
|
250
|
-
<xsl:apply-templates select="." mode="title-full"/>
|
|
251
|
-
</h2>
|
|
252
|
-
</section>
|
|
253
|
-
<xsl:apply-templates select="slide"/>
|
|
254
|
-
</section>
|
|
255
|
-
</xsl:when>
|
|
256
|
-
<xsl:when test="$reveal-navigation-mode = 'linear'">
|
|
257
|
-
<section>
|
|
258
|
-
<h2>
|
|
259
|
-
<xsl:apply-templates select="." mode="title-full"/>
|
|
260
|
-
</h2>
|
|
261
|
-
</section>
|
|
262
|
-
<xsl:apply-templates select="slide"/>
|
|
263
|
-
</xsl:when>
|
|
264
|
-
<xsl:otherwise>
|
|
265
|
-
<xsl:message >PTX:BUG: a reveal.js navigation mode ("<xsl:value-of select="$reveal-navigation-mode"/>") is implemented but the section construction is not prepared for that mode</xsl:message>
|
|
266
|
-
</xsl:otherwise>
|
|
267
|
-
</xsl:choose>
|
|
268
|
-
</xsl:template>
|
|
269
|
-
|
|
270
|
-
<xsl:template match="frontmatter">
|
|
271
|
-
<section>
|
|
272
|
-
<section>
|
|
273
|
-
<!-- we assume an overall title exists -->
|
|
274
|
-
<h1>
|
|
275
|
-
<xsl:apply-templates select="$root/slideshow" mode="title-full" />
|
|
276
|
-
</h1>
|
|
277
|
-
<!-- subtitle would be optional, subsidary -->
|
|
278
|
-
<xsl:if test="$root/slideshow/subtitle">
|
|
279
|
-
<h2>
|
|
280
|
-
<xsl:apply-templates select="$root/slideshow" mode="subtitle" />
|
|
281
|
-
</h2>
|
|
282
|
-
</xsl:if>
|
|
283
|
-
<!-- we assume at least one author, these are in a table -->
|
|
284
|
-
<xsl:apply-templates select="titlepage" mode="author-list"/>
|
|
285
|
-
<!-- optional "event" -->
|
|
286
|
-
<xsl:if test="bibinfo/event">
|
|
287
|
-
<h3>
|
|
288
|
-
<xsl:apply-templates select="bibinfo/event"/>
|
|
289
|
-
</h3>
|
|
290
|
-
</xsl:if>
|
|
291
|
-
<!-- optional "date" -->
|
|
292
|
-
<xsl:if test="bibinfo/date">
|
|
293
|
-
<h3>
|
|
294
|
-
<xsl:apply-templates select="bibinfo/date"/>
|
|
295
|
-
</h3>
|
|
296
|
-
</xsl:if>
|
|
297
|
-
</section>
|
|
298
|
-
<xsl:apply-templates select="abstract"/>
|
|
299
|
-
</section>
|
|
300
|
-
</xsl:template>
|
|
301
|
-
|
|
302
|
-
<xsl:template match="titlepage" mode="author-list">
|
|
303
|
-
<table>
|
|
304
|
-
<tr>
|
|
305
|
-
<xsl:for-each select="$bibinfo/author">
|
|
306
|
-
<th align="center" style="border-bottom: 0px;"><xsl:value-of select="personname"/></th>
|
|
307
|
-
</xsl:for-each>
|
|
308
|
-
</tr>
|
|
309
|
-
<tr>
|
|
310
|
-
<xsl:for-each select="$bibinfo/author">
|
|
311
|
-
<td align="center" style="border-bottom: 0px;"><xsl:value-of select="affiliation|institution"/></td>
|
|
312
|
-
</xsl:for-each>
|
|
313
|
-
</tr>
|
|
314
|
-
<tr>
|
|
315
|
-
<xsl:for-each select="$bibinfo/author">
|
|
316
|
-
<td align="center"><xsl:apply-templates select="logo" /></td>
|
|
317
|
-
</xsl:for-each>
|
|
318
|
-
</tr>
|
|
319
|
-
</table>
|
|
320
|
-
</xsl:template>
|
|
321
|
-
|
|
322
|
-
<xsl:template match="abstract">
|
|
323
|
-
<section>
|
|
324
|
-
<h2>Abstract</h2>
|
|
325
|
-
<div align="left">
|
|
326
|
-
<xsl:apply-templates select="*"/>
|
|
327
|
-
</div>
|
|
328
|
-
</section>
|
|
329
|
-
</xsl:template>
|
|
330
|
-
|
|
331
|
-
<xsl:template match="slide">
|
|
332
|
-
<section>
|
|
333
|
-
<xsl:variable name="slide-hN">
|
|
334
|
-
<xsl:apply-templates select="." mode="hN">
|
|
335
|
-
<xsl:with-param name="heading-level" select="$reveal-slide-heading-level"/>
|
|
336
|
-
</xsl:apply-templates>
|
|
337
|
-
</xsl:variable>
|
|
338
|
-
<xsl:element name="{$slide-hN}">
|
|
339
|
-
<xsl:apply-templates select="." mode="title-full" />
|
|
340
|
-
</xsl:element>
|
|
341
|
-
<div align="left">
|
|
342
|
-
<!-- Single monolithic page: heading levels are threaded, not -->
|
|
343
|
-
<!-- chunked. The slide title is one level below a "section" -->
|
|
344
|
-
<!-- (when present); slide content is one level below that. -->
|
|
345
|
-
<xsl:apply-templates select="*">
|
|
346
|
-
<xsl:with-param name="heading-level" select="$reveal-slide-heading-level + 1"/>
|
|
347
|
-
</xsl:apply-templates>
|
|
348
|
-
</div>
|
|
349
|
-
</section>
|
|
350
|
-
</xsl:template>
|
|
351
|
-
|
|
352
|
-
<xsl:template match="subslide">
|
|
353
|
-
<div class="fragment">
|
|
354
|
-
<xsl:apply-templates select="*"/>
|
|
355
|
-
</div>
|
|
356
|
-
</xsl:template>
|
|
357
|
-
|
|
358
|
-
<xsl:template match="ul/li|ol/li">
|
|
359
|
-
<li>
|
|
360
|
-
<xsl:if test="parent::*/@pause = 'yes'">
|
|
361
|
-
<xsl:attribute name="class">
|
|
362
|
-
<xsl:text>fragment</xsl:text>
|
|
363
|
-
</xsl:attribute>
|
|
364
|
-
</xsl:if>
|
|
365
|
-
<!-- content may be structured, or not -->
|
|
366
|
-
<xsl:if test="title">
|
|
367
|
-
<h6 class="heading">
|
|
368
|
-
<span class="title">
|
|
369
|
-
<xsl:apply-templates select="." mode="title-xref"/>
|
|
370
|
-
</span>
|
|
371
|
-
</h6>
|
|
372
|
-
</xsl:if>
|
|
373
|
-
<xsl:apply-templates/>
|
|
374
|
-
</li>
|
|
375
|
-
</xsl:template>
|
|
376
|
-
|
|
377
|
-
<!-- We group dt/dd pairs in a div so that fragments work properly -->
|
|
378
|
-
<!-- Yes, this seems to be legitimate HTML structure -->
|
|
379
|
-
<!-- https://www.stefanjudis.com/today-i-learned/ -->
|
|
380
|
-
<!-- divs-are-valid-elements-inside-of-a-definition-list/ -->
|
|
381
|
-
<xsl:template match="dl/li">
|
|
382
|
-
<div>
|
|
383
|
-
<xsl:if test="parent::*/@pause = 'yes'">
|
|
384
|
-
<xsl:attribute name="class">
|
|
385
|
-
<xsl:text>fragment</xsl:text>
|
|
386
|
-
</xsl:attribute>
|
|
387
|
-
</xsl:if>
|
|
388
|
-
<dt>
|
|
389
|
-
<xsl:apply-templates select="." mode="title-full"/>
|
|
390
|
-
</dt>
|
|
391
|
-
<dd>
|
|
392
|
-
<!-- assumes content part is structured -->
|
|
393
|
-
<!-- title gets killed on-sight -->
|
|
394
|
-
<xsl:apply-templates select="*"/>
|
|
395
|
-
</dd>
|
|
396
|
-
</div>
|
|
397
|
-
</xsl:template>
|
|
398
|
-
|
|
399
|
-
<xsl:template match="p">
|
|
400
|
-
<p>
|
|
401
|
-
<xsl:if test="@pause = 'yes'">
|
|
402
|
-
<xsl:attribute name="class">
|
|
403
|
-
<xsl:text>fragment</xsl:text>
|
|
404
|
-
</xsl:attribute>
|
|
405
|
-
</xsl:if>
|
|
406
|
-
<xsl:apply-templates/>
|
|
407
|
-
</p>
|
|
408
|
-
</xsl:template>
|
|
409
|
-
|
|
410
|
-
<!-- Images get wrapped in a div with @class="fragment" if they are -->
|
|
411
|
-
<!-- paused -->
|
|
412
|
-
<xsl:template match="image[not(ancestor::sidebyside) and (@pause='yes')]">
|
|
413
|
-
<div class="fragment">
|
|
414
|
-
<xsl:apply-imports/>
|
|
415
|
-
</div>
|
|
416
|
-
</xsl:template>
|
|
417
|
-
|
|
418
|
-
<!-- Side-By-Side -->
|
|
419
|
-
<!-- Built by implementing two abstract -->
|
|
420
|
-
<!-- templates from the -common templates -->
|
|
421
|
-
|
|
422
|
-
<!-- Overall wrapper of a sidebyside -->
|
|
423
|
-
<xsl:template match="sidebyside" mode="compose-panels">
|
|
424
|
-
<xsl:param name="layout" />
|
|
425
|
-
<xsl:param name="panels" />
|
|
426
|
-
|
|
427
|
-
<xsl:variable name="left-margin" select="$layout/left-margin" />
|
|
428
|
-
<xsl:variable name="right-margin" select="$layout/right-margin" />
|
|
429
|
-
|
|
430
|
-
<div style="display: table;">
|
|
431
|
-
<xsl:attribute name="class">
|
|
432
|
-
<xsl:text>sidebyside</xsl:text>
|
|
433
|
-
</xsl:attribute>
|
|
434
|
-
<xsl:attribute name="style">
|
|
435
|
-
<xsl:text>display:table;</xsl:text>
|
|
436
|
-
<xsl:text>margin-left:</xsl:text>
|
|
437
|
-
<xsl:value-of select="$left-margin" />
|
|
438
|
-
<xsl:text>;</xsl:text>
|
|
439
|
-
<xsl:text>margin-right:</xsl:text>
|
|
440
|
-
<xsl:value-of select="$right-margin" />
|
|
441
|
-
<xsl:text>;</xsl:text>
|
|
442
|
-
</xsl:attribute>
|
|
443
|
-
<xsl:copy-of select="$panels" />
|
|
444
|
-
</div>
|
|
445
|
-
</xsl:template>
|
|
446
|
-
|
|
447
|
-
<!-- A single panel of the sidebyside -->
|
|
448
|
-
<xsl:template match="*" mode="panel-panel">
|
|
449
|
-
<xsl:param name="width" />
|
|
450
|
-
<xsl:param name="left-margin" />
|
|
451
|
-
<xsl:param name="right-margin" />
|
|
452
|
-
<xsl:param name="valign" />
|
|
453
|
-
|
|
454
|
-
<xsl:element name="div">
|
|
455
|
-
<xsl:if test="parent::sidebyside/@pause = 'yes'">
|
|
456
|
-
<xsl:attribute name="class">
|
|
457
|
-
<xsl:text>fragment</xsl:text>
|
|
458
|
-
</xsl:attribute>
|
|
459
|
-
</xsl:if>
|
|
460
|
-
<xsl:attribute name="style">
|
|
461
|
-
<xsl:text>display:table-cell;</xsl:text>
|
|
462
|
-
<xsl:text>width:</xsl:text>
|
|
463
|
-
<xsl:call-template name="relative-width">
|
|
464
|
-
<xsl:with-param name="width" select="$width" />
|
|
465
|
-
<xsl:with-param name="left-margin" select="$left-margin" />
|
|
466
|
-
<xsl:with-param name="right-margin" select="$right-margin" />
|
|
467
|
-
</xsl:call-template>
|
|
468
|
-
<xsl:text>;</xsl:text>
|
|
469
|
-
<!-- top, middle, bottom -->
|
|
470
|
-
<xsl:text>vertical-align:</xsl:text>
|
|
471
|
-
<xsl:value-of select="$valign"/>
|
|
472
|
-
<xsl:text>;</xsl:text>
|
|
473
|
-
</xsl:attribute>
|
|
474
|
-
<!-- Realize each panel's object -->
|
|
475
|
-
<xsl:apply-templates select=".">
|
|
476
|
-
<xsl:with-param name="width" select="$width" />
|
|
477
|
-
</xsl:apply-templates>
|
|
478
|
-
</xsl:element>
|
|
479
|
-
</xsl:template>
|
|
480
|
-
|
|
481
|
-
<!-- The content of a cross-reference is computed by the -common -->
|
|
482
|
-
<!-- machinery; on a slide we do not make it a live link, since -->
|
|
483
|
-
<!-- the likely target is a nearby slide and knowls do not exist. -->
|
|
484
|
-
<xsl:template match="*" mode="xref-link">
|
|
485
|
-
<xsl:param name="target"/>
|
|
486
|
-
<xsl:param name="content"/>
|
|
487
|
-
<xsl:param name="origin"/>
|
|
488
|
-
<xsl:copy-of select="$content"/>
|
|
489
|
-
</xsl:template>
|
|
490
|
-
|
|
491
|
-
<!-- We don't want any permalinks -->
|
|
492
|
-
<xsl:template match="*" mode="permalink"/>
|
|
493
|
-
|
|
494
|
-
<!-- ######## -->
|
|
495
|
-
<!-- Bad Bank -->
|
|
496
|
-
<!-- ######## -->
|
|
497
|
-
|
|
498
|
-
<!-- Reveal.js specific, so best to place inside this stylesheet. -->
|
|
499
|
-
|
|
500
|
-
<!-- A couple of temporary command-line stringparam will just be -->
|
|
501
|
-
<!-- ignored as this stylesheet was first released about the time -->
|
|
502
|
-
<!-- the publisher file came into existence. -->
|
|
503
|
-
|
|
504
|
-
<!-- 2020-02-09: Stopped using a temporary "theme" stringparam -->
|
|
505
|
-
<xsl:param name="theme" select="''"/>
|
|
506
|
-
<!-- 2020-02-09: Stopped using a temporary "local" stringparam -->
|
|
507
|
-
<xsl:param name="local" select="''"/>
|
|
508
|
-
|
|
509
|
-
<xsl:template name="reveal-warnings">
|
|
510
|
-
<xsl:call-template name="banner-warning">
|
|
511
|
-
<xsl:with-param name="warning">Conversion to reveal.js presentations/slideshows is experimental
Requests for additional specific constructions welcome
Additional PreTeXt elements are subject to change</xsl:with-param>
|
|
512
|
-
</xsl:call-template>
|
|
513
|
-
<xsl:if test="not($theme = '')">
|
|
514
|
-
<xsl:message >PTX:WARNING: the temporary "theme" stringparam is deprecated and is being ignored by the conversion to a Reveal.js slideshow. Please switch to using a publisher file to set this option, see documentation in The Guide. The default theme is "simple".</xsl:message>
|
|
515
|
-
<xsl:text>simple</xsl:text>
|
|
516
|
-
</xsl:if>
|
|
517
|
-
<xsl:if test="not($local = '')">
|
|
518
|
-
<xsl:message >PTX:WARNING: the temporary "local" stringparam is deprecated and is being ignored. Please switch to using a publisher file to set this option, see documentation in The Guide. The default behavior is to get resources from a CDN.</xsl:message>
|
|
519
|
-
</xsl:if>
|
|
520
|
-
</xsl:template>
|
|
521
|
-
|
|
522
|
-
</xsl:stylesheet>
|
|
1
|
+
<?xml version='1.0'?>
|
|
2
|
+
|
|
3
|
+
<!--********************************************************************
|
|
4
|
+
Copyright 2019 Andrew Rechnitzer, Steven Clontz, 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
|
+
<!-- http://pimpmyxslt.com/articles/entity-tricks-part2/ -->
|
|
23
|
+
<!DOCTYPE xsl:stylesheet [
|
|
24
|
+
<!ENTITY % entities SYSTEM "entities.ent">
|
|
25
|
+
%entities;
|
|
26
|
+
]>
|
|
27
|
+
|
|
28
|
+
<!-- "pi" necessary to trap "visual" URLs automatically being -->
|
|
29
|
+
<!-- added by "assembly" for with-content "url" elements -->
|
|
30
|
+
<xsl:stylesheet
|
|
31
|
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
|
32
|
+
xmlns:xml="http://www.w3.org/XML/1998/namespace"
|
|
33
|
+
xmlns:pi="http://pretextbook.org/2020/pretext/internal"
|
|
34
|
+
xmlns:exsl="http://exslt.org/common"
|
|
35
|
+
xmlns:date="http://exslt.org/dates-and-times"
|
|
36
|
+
xmlns:str="http://exslt.org/strings"
|
|
37
|
+
extension-element-prefixes="exsl date str"
|
|
38
|
+
>
|
|
39
|
+
|
|
40
|
+
<!-- Necessary to get some HTML constructions, -->
|
|
41
|
+
<!-- but want to be sure to override the entry -->
|
|
42
|
+
<!-- template to avoid chunking, etc. -->
|
|
43
|
+
<!-- The pretext-assembly stylesheet is employed, -->
|
|
44
|
+
<!-- so be sure to use the right trees in the -->
|
|
45
|
+
<!-- entry template -->
|
|
46
|
+
<xsl:import href="pretext-html.xsl" />
|
|
47
|
+
|
|
48
|
+
<!-- Disable clipboardable -->
|
|
49
|
+
<xsl:template name="insert-clipboardable-class"/>
|
|
50
|
+
|
|
51
|
+
<!-- Used to identify build target in templates shared with plain -->
|
|
52
|
+
<!-- HTML conversion (preferably avoid using this). -->
|
|
53
|
+
<xsl:variable name="b-reveal-build" select="true()" />
|
|
54
|
+
|
|
55
|
+
<!-- Reveal.js output is one monolithic page, so heading levels are -->
|
|
56
|
+
<!-- threaded, not chunked. The slideshow title (h1) and subtitle -->
|
|
57
|
+
<!-- (h2) are fixed. A "section" is always level 2 (sections never -->
|
|
58
|
+
<!-- nest in a slideshow), so a "slide" title is level 3 when there -->
|
|
59
|
+
<!-- are sections and level 2 when there are none; slide content -->
|
|
60
|
+
<!-- begins one level deeper. -->
|
|
61
|
+
<xsl:variable name="b-reveal-has-sections" select="boolean($root/slideshow/section)"/>
|
|
62
|
+
<xsl:variable name="reveal-slide-heading-level">
|
|
63
|
+
<xsl:choose>
|
|
64
|
+
<xsl:when test="$b-reveal-has-sections">
|
|
65
|
+
<xsl:text>3</xsl:text>
|
|
66
|
+
</xsl:when>
|
|
67
|
+
<xsl:otherwise>
|
|
68
|
+
<xsl:text>2</xsl:text>
|
|
69
|
+
</xsl:otherwise>
|
|
70
|
+
</xsl:choose>
|
|
71
|
+
</xsl:variable>
|
|
72
|
+
|
|
73
|
+
<!-- HTML5 format -->
|
|
74
|
+
<xsl:output method="html" indent="yes" encoding="UTF-8" doctype-system="about:legacy-compat"/>
|
|
75
|
+
|
|
76
|
+
<!-- Publisher Switches -->
|
|
77
|
+
<!-- Various configuration options are set in the publisher file, -->
|
|
78
|
+
<!-- which is analyzed by its own stylesheet, which is imported in -->
|
|
79
|
+
<!-- the process of importing the pretext-html.xsl stylesheet. -->
|
|
80
|
+
|
|
81
|
+
<!-- ################ -->
|
|
82
|
+
<!-- # Entry Template -->
|
|
83
|
+
<!-- ################ -->
|
|
84
|
+
|
|
85
|
+
<!-- We override the entry template, so as to avoid the "chunking" -->
|
|
86
|
+
<!-- procedure, since we are going to *always* produce one monolithic -->
|
|
87
|
+
<!-- HTML file as the output/slideshow -->
|
|
88
|
+
<xsl:template match="/">
|
|
89
|
+
<xsl:call-template name="reveal-warnings"/>
|
|
90
|
+
<xsl:apply-templates select="$original" mode="generic-warnings"/>
|
|
91
|
+
<xsl:apply-templates select="$original" mode="element-deprecation-warnings"/>
|
|
92
|
+
<xsl:apply-templates select="$original" mode="parameter-deprecation-warnings"/>
|
|
93
|
+
<xsl:apply-templates select="$root"/>
|
|
94
|
+
</xsl:template>
|
|
95
|
+
|
|
96
|
+
<xsl:template match="/pretext">
|
|
97
|
+
<xsl:apply-templates select="slideshow" />
|
|
98
|
+
</xsl:template>
|
|
99
|
+
|
|
100
|
+
<!-- Kill creation of the index page from the -html -->
|
|
101
|
+
<!-- conversion (we just build one monolithic page) -->
|
|
102
|
+
<xsl:variable name="html-index-page" select="/.."/>
|
|
103
|
+
|
|
104
|
+
<!-- Kill knowl-ing of various environments -->
|
|
105
|
+
<xsl:template match="&THEOREM-LIKE;|&PROOF-LIKE;|&DEFINITION-LIKE;|&EXAMPLE-LIKE;|&PROJECT-LIKE;|task|&FIGURE-LIKE;|&REMARK-LIKE;|&GOAL-LIKE;|exercise" mode="is-hidden">
|
|
106
|
+
<xsl:text>no</xsl:text>
|
|
107
|
+
</xsl:template>
|
|
108
|
+
|
|
109
|
+
<!-- The HTML conversion computes a global "universal" Table of -->
|
|
110
|
+
<!-- Contents for the sidebar. Then later, for each page it sees -->
|
|
111
|
+
<!-- some customization. So we reset the variable here, and that -->
|
|
112
|
+
<!-- also means the work done in the "toc-items" template never -->
|
|
113
|
+
<!-- occurs. (And even better, doing the work was exposing that -->
|
|
114
|
+
<!-- the "level" template wasn't working right for a "slideshow".) -->
|
|
115
|
+
<xsl:variable name="toc-cache-rtf" select="''"/>
|
|
116
|
+
|
|
117
|
+
<!-- Write the infrastructure for a page -->
|
|
118
|
+
<xsl:template match="slideshow">
|
|
119
|
+
<xsl:call-template name="converter-blurb-html" />
|
|
120
|
+
<html>
|
|
121
|
+
<head>
|
|
122
|
+
<title>
|
|
123
|
+
<xsl:apply-templates select="." mode="title-simple" />
|
|
124
|
+
</title>
|
|
125
|
+
|
|
126
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=yes"></meta>
|
|
127
|
+
|
|
128
|
+
<xsl:call-template name="sagecell-code" />
|
|
129
|
+
<xsl:apply-templates select="." mode="sagecell" />
|
|
130
|
+
<xsl:call-template name="syntax-highlight"/>
|
|
131
|
+
|
|
132
|
+
<!-- load reveal.js resources; w/ v 4.1.2 -->
|
|
133
|
+
<!-- these seem to be *always* minified -->
|
|
134
|
+
<link href="{$reveal-root}/reset.css" rel="stylesheet"></link>
|
|
135
|
+
<link href="{$reveal-root}/reveal.css" rel="stylesheet"></link>
|
|
136
|
+
<link href="{$reveal-root}/theme/{$reveal-theme}.css" rel="stylesheet"></link>
|
|
137
|
+
<script src="{$reveal-root}/reveal.js"></script>
|
|
138
|
+
<script src="{$reveal-root}/plugin/math/math.js"></script>
|
|
139
|
+
|
|
140
|
+
<link href="_static/pretext/css/pretext-reveal.css" rel="stylesheet"></link>
|
|
141
|
+
<style>
|
|
142
|
+
</style>
|
|
143
|
+
<xsl:call-template name="diagcess-header"/>
|
|
144
|
+
|
|
145
|
+
<!-- custom-css, if specified, should be last -->
|
|
146
|
+
<xsl:if test="not($reveal-custom-css = '')">
|
|
147
|
+
<xsl:variable name="csses" select="str:tokenize($reveal-custom-css, ', ')"/>
|
|
148
|
+
<xsl:for-each select="$csses">
|
|
149
|
+
<link rel="stylesheet" type="text/css">
|
|
150
|
+
<xsl:attribute name="href">
|
|
151
|
+
<xsl:value-of select="." />
|
|
152
|
+
</xsl:attribute>
|
|
153
|
+
</link>
|
|
154
|
+
</xsl:for-each>
|
|
155
|
+
</xsl:if>
|
|
156
|
+
</head>
|
|
157
|
+
|
|
158
|
+
<body>
|
|
159
|
+
<div class="reveal ptx-content">
|
|
160
|
+
<!-- For mathematics/MathJax, must be located -->
|
|
161
|
+
<!-- within div.reveal to be effective -->
|
|
162
|
+
<xsl:apply-templates select="." mode="latex-macros"/>
|
|
163
|
+
<div class="slides">
|
|
164
|
+
<xsl:apply-templates select="frontmatter"/>
|
|
165
|
+
<xsl:apply-templates select="section|slide"/>
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
<xsl:call-template name="diagcess-footer"/>
|
|
169
|
+
</body>
|
|
170
|
+
|
|
171
|
+
<script>
|
|
172
|
+
<xsl:text>
</xsl:text>
|
|
173
|
+
<xsl:text>Reveal.initialize({
</xsl:text>
|
|
174
|
+
<xsl:text> controls: </xsl:text>
|
|
175
|
+
<xsl:choose>
|
|
176
|
+
<xsl:when test="$b-reveal-control-display">
|
|
177
|
+
<xsl:text>true</xsl:text>
|
|
178
|
+
</xsl:when>
|
|
179
|
+
<xsl:otherwise>
|
|
180
|
+
<xsl:text>false</xsl:text>
|
|
181
|
+
</xsl:otherwise>
|
|
182
|
+
</xsl:choose>
|
|
183
|
+
<xsl:text>,
</xsl:text>
|
|
184
|
+
<xsl:text> controlsTutorial: </xsl:text>
|
|
185
|
+
<xsl:choose>
|
|
186
|
+
<xsl:when test="$b-reveal-control-tutorial">
|
|
187
|
+
<xsl:text>true</xsl:text>
|
|
188
|
+
</xsl:when>
|
|
189
|
+
<xsl:otherwise>
|
|
190
|
+
<xsl:text>false</xsl:text>
|
|
191
|
+
</xsl:otherwise>
|
|
192
|
+
</xsl:choose>
|
|
193
|
+
<xsl:text>,
</xsl:text>
|
|
194
|
+
<xsl:text> controlsLayout: '</xsl:text>
|
|
195
|
+
<xsl:value-of select="$reveal-control-layout"/>
|
|
196
|
+
<xsl:text>',
</xsl:text>
|
|
197
|
+
<xsl:text> controlsBackArrows: '</xsl:text>
|
|
198
|
+
<xsl:value-of select="$reveal-control-backarrow"/>
|
|
199
|
+
<xsl:text>',
</xsl:text>
|
|
200
|
+
<xsl:text> navigationMode: '</xsl:text>
|
|
201
|
+
<xsl:value-of select="$reveal-navigation-mode"/>
|
|
202
|
+
<xsl:text>',
</xsl:text>
|
|
203
|
+
<xsl:text> progress: false,
</xsl:text>
|
|
204
|
+
<xsl:text> center: false,
</xsl:text>
|
|
205
|
+
<xsl:text> hash: true,
</xsl:text>
|
|
206
|
+
<xsl:text> transition: 'fade',
</xsl:text>
|
|
207
|
+
<xsl:text> width: "100%",
</xsl:text>
|
|
208
|
+
<xsl:text> height: "100%",
</xsl:text>
|
|
209
|
+
<xsl:text> margin: "0.025",
</xsl:text>
|
|
210
|
+
<!-- Explicitly enable AMS-style inline \(...\), -->
|
|
211
|
+
<!-- and explicitly disable TeX-style inline $...$ -->
|
|
212
|
+
<!-- The main HTML conversion does not do anything -->
|
|
213
|
+
<!-- special for display math, so we disable any such -->
|
|
214
|
+
<!-- markup, since we use environments exclusively. -->
|
|
215
|
+
<!-- N.B. default HTML adds a "zero-width" space into -->
|
|
216
|
+
<!-- a \( authored in a non-math context. -->
|
|
217
|
+
<!-- N.B. This may need to be changed for MathJax 3 -->
|
|
218
|
+
|
|
219
|
+
<!-- Suggested by https://revealjs.com/math/, 2021-09-19 -->
|
|
220
|
+
<xsl:text> math: {
</xsl:text>
|
|
221
|
+
<xsl:text> mathjax: 'https://cdn.jsdelivr.net/gh/mathjax/mathjax@2.7.8/MathJax.js',
</xsl:text>
|
|
222
|
+
<xsl:text> config: 'TeX-AMS_HTML-full',
</xsl:text>
|
|
223
|
+
<xsl:text> // other options are passed into MathJax.Hub.Config()
</xsl:text>
|
|
224
|
+
<xsl:text> tex2jax: {
</xsl:text>
|
|
225
|
+
<xsl:text> inlineMath: [['\\(','\\)']],
</xsl:text>
|
|
226
|
+
<xsl:text> displayMath: [],
</xsl:text>
|
|
227
|
+
<xsl:text> }
</xsl:text>
|
|
228
|
+
<xsl:text> },
</xsl:text>
|
|
229
|
+
<xsl:text> plugins: [ RevealMath ]
</xsl:text>
|
|
230
|
+
<xsl:text>});
</xsl:text>
|
|
231
|
+
</script>
|
|
232
|
+
</html>
|
|
233
|
+
</xsl:template>
|
|
234
|
+
|
|
235
|
+
<!-- A "section" contains multiple "slide", which we process, -->
|
|
236
|
+
<!-- but first we make a special slide announcing the "section" -->
|
|
237
|
+
<!-- With reveal.js navigationMode set to "default" or "grid" -->
|
|
238
|
+
<!-- we organize title slides as the "horizontal" (or major) -->
|
|
239
|
+
<!-- slides, with the slides within a section as the "vertical" -->
|
|
240
|
+
<!-- (or minor) slides. But if the navigationMode is "linear" -->
|
|
241
|
+
<!-- we do not even create this two-deep organization at all, -->
|
|
242
|
+
<!-- in part because we think the linear mode is buggy for -->
|
|
243
|
+
<!-- the last vertical set. -->
|
|
244
|
+
<xsl:template match="section">
|
|
245
|
+
<xsl:choose>
|
|
246
|
+
<xsl:when test="($reveal-navigation-mode = 'default') or ($reveal-navigation-mode = 'grid')">
|
|
247
|
+
<section>
|
|
248
|
+
<section>
|
|
249
|
+
<h2>
|
|
250
|
+
<xsl:apply-templates select="." mode="title-full"/>
|
|
251
|
+
</h2>
|
|
252
|
+
</section>
|
|
253
|
+
<xsl:apply-templates select="slide"/>
|
|
254
|
+
</section>
|
|
255
|
+
</xsl:when>
|
|
256
|
+
<xsl:when test="$reveal-navigation-mode = 'linear'">
|
|
257
|
+
<section>
|
|
258
|
+
<h2>
|
|
259
|
+
<xsl:apply-templates select="." mode="title-full"/>
|
|
260
|
+
</h2>
|
|
261
|
+
</section>
|
|
262
|
+
<xsl:apply-templates select="slide"/>
|
|
263
|
+
</xsl:when>
|
|
264
|
+
<xsl:otherwise>
|
|
265
|
+
<xsl:message >PTX:BUG: a reveal.js navigation mode ("<xsl:value-of select="$reveal-navigation-mode"/>") is implemented but the section construction is not prepared for that mode</xsl:message>
|
|
266
|
+
</xsl:otherwise>
|
|
267
|
+
</xsl:choose>
|
|
268
|
+
</xsl:template>
|
|
269
|
+
|
|
270
|
+
<xsl:template match="frontmatter">
|
|
271
|
+
<section>
|
|
272
|
+
<section>
|
|
273
|
+
<!-- we assume an overall title exists -->
|
|
274
|
+
<h1>
|
|
275
|
+
<xsl:apply-templates select="$root/slideshow" mode="title-full" />
|
|
276
|
+
</h1>
|
|
277
|
+
<!-- subtitle would be optional, subsidary -->
|
|
278
|
+
<xsl:if test="$root/slideshow/subtitle">
|
|
279
|
+
<h2>
|
|
280
|
+
<xsl:apply-templates select="$root/slideshow" mode="subtitle" />
|
|
281
|
+
</h2>
|
|
282
|
+
</xsl:if>
|
|
283
|
+
<!-- we assume at least one author, these are in a table -->
|
|
284
|
+
<xsl:apply-templates select="titlepage" mode="author-list"/>
|
|
285
|
+
<!-- optional "event" -->
|
|
286
|
+
<xsl:if test="bibinfo/event">
|
|
287
|
+
<h3>
|
|
288
|
+
<xsl:apply-templates select="bibinfo/event"/>
|
|
289
|
+
</h3>
|
|
290
|
+
</xsl:if>
|
|
291
|
+
<!-- optional "date" -->
|
|
292
|
+
<xsl:if test="bibinfo/date">
|
|
293
|
+
<h3>
|
|
294
|
+
<xsl:apply-templates select="bibinfo/date"/>
|
|
295
|
+
</h3>
|
|
296
|
+
</xsl:if>
|
|
297
|
+
</section>
|
|
298
|
+
<xsl:apply-templates select="abstract"/>
|
|
299
|
+
</section>
|
|
300
|
+
</xsl:template>
|
|
301
|
+
|
|
302
|
+
<xsl:template match="titlepage" mode="author-list">
|
|
303
|
+
<table>
|
|
304
|
+
<tr>
|
|
305
|
+
<xsl:for-each select="$bibinfo/author">
|
|
306
|
+
<th align="center" style="border-bottom: 0px;"><xsl:value-of select="personname"/></th>
|
|
307
|
+
</xsl:for-each>
|
|
308
|
+
</tr>
|
|
309
|
+
<tr>
|
|
310
|
+
<xsl:for-each select="$bibinfo/author">
|
|
311
|
+
<td align="center" style="border-bottom: 0px;"><xsl:value-of select="affiliation|institution"/></td>
|
|
312
|
+
</xsl:for-each>
|
|
313
|
+
</tr>
|
|
314
|
+
<tr>
|
|
315
|
+
<xsl:for-each select="$bibinfo/author">
|
|
316
|
+
<td align="center"><xsl:apply-templates select="logo" /></td>
|
|
317
|
+
</xsl:for-each>
|
|
318
|
+
</tr>
|
|
319
|
+
</table>
|
|
320
|
+
</xsl:template>
|
|
321
|
+
|
|
322
|
+
<xsl:template match="abstract">
|
|
323
|
+
<section>
|
|
324
|
+
<h2>Abstract</h2>
|
|
325
|
+
<div align="left">
|
|
326
|
+
<xsl:apply-templates select="*"/>
|
|
327
|
+
</div>
|
|
328
|
+
</section>
|
|
329
|
+
</xsl:template>
|
|
330
|
+
|
|
331
|
+
<xsl:template match="slide">
|
|
332
|
+
<section>
|
|
333
|
+
<xsl:variable name="slide-hN">
|
|
334
|
+
<xsl:apply-templates select="." mode="hN">
|
|
335
|
+
<xsl:with-param name="heading-level" select="$reveal-slide-heading-level"/>
|
|
336
|
+
</xsl:apply-templates>
|
|
337
|
+
</xsl:variable>
|
|
338
|
+
<xsl:element name="{$slide-hN}">
|
|
339
|
+
<xsl:apply-templates select="." mode="title-full" />
|
|
340
|
+
</xsl:element>
|
|
341
|
+
<div align="left">
|
|
342
|
+
<!-- Single monolithic page: heading levels are threaded, not -->
|
|
343
|
+
<!-- chunked. The slide title is one level below a "section" -->
|
|
344
|
+
<!-- (when present); slide content is one level below that. -->
|
|
345
|
+
<xsl:apply-templates select="*">
|
|
346
|
+
<xsl:with-param name="heading-level" select="$reveal-slide-heading-level + 1"/>
|
|
347
|
+
</xsl:apply-templates>
|
|
348
|
+
</div>
|
|
349
|
+
</section>
|
|
350
|
+
</xsl:template>
|
|
351
|
+
|
|
352
|
+
<xsl:template match="subslide">
|
|
353
|
+
<div class="fragment">
|
|
354
|
+
<xsl:apply-templates select="*"/>
|
|
355
|
+
</div>
|
|
356
|
+
</xsl:template>
|
|
357
|
+
|
|
358
|
+
<xsl:template match="ul/li|ol/li">
|
|
359
|
+
<li>
|
|
360
|
+
<xsl:if test="parent::*/@pause = 'yes'">
|
|
361
|
+
<xsl:attribute name="class">
|
|
362
|
+
<xsl:text>fragment</xsl:text>
|
|
363
|
+
</xsl:attribute>
|
|
364
|
+
</xsl:if>
|
|
365
|
+
<!-- content may be structured, or not -->
|
|
366
|
+
<xsl:if test="title">
|
|
367
|
+
<h6 class="heading">
|
|
368
|
+
<span class="title">
|
|
369
|
+
<xsl:apply-templates select="." mode="title-xref"/>
|
|
370
|
+
</span>
|
|
371
|
+
</h6>
|
|
372
|
+
</xsl:if>
|
|
373
|
+
<xsl:apply-templates/>
|
|
374
|
+
</li>
|
|
375
|
+
</xsl:template>
|
|
376
|
+
|
|
377
|
+
<!-- We group dt/dd pairs in a div so that fragments work properly -->
|
|
378
|
+
<!-- Yes, this seems to be legitimate HTML structure -->
|
|
379
|
+
<!-- https://www.stefanjudis.com/today-i-learned/ -->
|
|
380
|
+
<!-- divs-are-valid-elements-inside-of-a-definition-list/ -->
|
|
381
|
+
<xsl:template match="dl/li">
|
|
382
|
+
<div>
|
|
383
|
+
<xsl:if test="parent::*/@pause = 'yes'">
|
|
384
|
+
<xsl:attribute name="class">
|
|
385
|
+
<xsl:text>fragment</xsl:text>
|
|
386
|
+
</xsl:attribute>
|
|
387
|
+
</xsl:if>
|
|
388
|
+
<dt>
|
|
389
|
+
<xsl:apply-templates select="." mode="title-full"/>
|
|
390
|
+
</dt>
|
|
391
|
+
<dd>
|
|
392
|
+
<!-- assumes content part is structured -->
|
|
393
|
+
<!-- title gets killed on-sight -->
|
|
394
|
+
<xsl:apply-templates select="*"/>
|
|
395
|
+
</dd>
|
|
396
|
+
</div>
|
|
397
|
+
</xsl:template>
|
|
398
|
+
|
|
399
|
+
<xsl:template match="p">
|
|
400
|
+
<p>
|
|
401
|
+
<xsl:if test="@pause = 'yes'">
|
|
402
|
+
<xsl:attribute name="class">
|
|
403
|
+
<xsl:text>fragment</xsl:text>
|
|
404
|
+
</xsl:attribute>
|
|
405
|
+
</xsl:if>
|
|
406
|
+
<xsl:apply-templates/>
|
|
407
|
+
</p>
|
|
408
|
+
</xsl:template>
|
|
409
|
+
|
|
410
|
+
<!-- Images get wrapped in a div with @class="fragment" if they are -->
|
|
411
|
+
<!-- paused -->
|
|
412
|
+
<xsl:template match="image[not(ancestor::sidebyside) and (@pause='yes')]">
|
|
413
|
+
<div class="fragment">
|
|
414
|
+
<xsl:apply-imports/>
|
|
415
|
+
</div>
|
|
416
|
+
</xsl:template>
|
|
417
|
+
|
|
418
|
+
<!-- Side-By-Side -->
|
|
419
|
+
<!-- Built by implementing two abstract -->
|
|
420
|
+
<!-- templates from the -common templates -->
|
|
421
|
+
|
|
422
|
+
<!-- Overall wrapper of a sidebyside -->
|
|
423
|
+
<xsl:template match="sidebyside" mode="compose-panels">
|
|
424
|
+
<xsl:param name="layout" />
|
|
425
|
+
<xsl:param name="panels" />
|
|
426
|
+
|
|
427
|
+
<xsl:variable name="left-margin" select="$layout/left-margin" />
|
|
428
|
+
<xsl:variable name="right-margin" select="$layout/right-margin" />
|
|
429
|
+
|
|
430
|
+
<div style="display: table;">
|
|
431
|
+
<xsl:attribute name="class">
|
|
432
|
+
<xsl:text>sidebyside</xsl:text>
|
|
433
|
+
</xsl:attribute>
|
|
434
|
+
<xsl:attribute name="style">
|
|
435
|
+
<xsl:text>display:table;</xsl:text>
|
|
436
|
+
<xsl:text>margin-left:</xsl:text>
|
|
437
|
+
<xsl:value-of select="$left-margin" />
|
|
438
|
+
<xsl:text>;</xsl:text>
|
|
439
|
+
<xsl:text>margin-right:</xsl:text>
|
|
440
|
+
<xsl:value-of select="$right-margin" />
|
|
441
|
+
<xsl:text>;</xsl:text>
|
|
442
|
+
</xsl:attribute>
|
|
443
|
+
<xsl:copy-of select="$panels" />
|
|
444
|
+
</div>
|
|
445
|
+
</xsl:template>
|
|
446
|
+
|
|
447
|
+
<!-- A single panel of the sidebyside -->
|
|
448
|
+
<xsl:template match="*" mode="panel-panel">
|
|
449
|
+
<xsl:param name="width" />
|
|
450
|
+
<xsl:param name="left-margin" />
|
|
451
|
+
<xsl:param name="right-margin" />
|
|
452
|
+
<xsl:param name="valign" />
|
|
453
|
+
|
|
454
|
+
<xsl:element name="div">
|
|
455
|
+
<xsl:if test="parent::sidebyside/@pause = 'yes'">
|
|
456
|
+
<xsl:attribute name="class">
|
|
457
|
+
<xsl:text>fragment</xsl:text>
|
|
458
|
+
</xsl:attribute>
|
|
459
|
+
</xsl:if>
|
|
460
|
+
<xsl:attribute name="style">
|
|
461
|
+
<xsl:text>display:table-cell;</xsl:text>
|
|
462
|
+
<xsl:text>width:</xsl:text>
|
|
463
|
+
<xsl:call-template name="relative-width">
|
|
464
|
+
<xsl:with-param name="width" select="$width" />
|
|
465
|
+
<xsl:with-param name="left-margin" select="$left-margin" />
|
|
466
|
+
<xsl:with-param name="right-margin" select="$right-margin" />
|
|
467
|
+
</xsl:call-template>
|
|
468
|
+
<xsl:text>;</xsl:text>
|
|
469
|
+
<!-- top, middle, bottom -->
|
|
470
|
+
<xsl:text>vertical-align:</xsl:text>
|
|
471
|
+
<xsl:value-of select="$valign"/>
|
|
472
|
+
<xsl:text>;</xsl:text>
|
|
473
|
+
</xsl:attribute>
|
|
474
|
+
<!-- Realize each panel's object -->
|
|
475
|
+
<xsl:apply-templates select=".">
|
|
476
|
+
<xsl:with-param name="width" select="$width" />
|
|
477
|
+
</xsl:apply-templates>
|
|
478
|
+
</xsl:element>
|
|
479
|
+
</xsl:template>
|
|
480
|
+
|
|
481
|
+
<!-- The content of a cross-reference is computed by the -common -->
|
|
482
|
+
<!-- machinery; on a slide we do not make it a live link, since -->
|
|
483
|
+
<!-- the likely target is a nearby slide and knowls do not exist. -->
|
|
484
|
+
<xsl:template match="*" mode="xref-link">
|
|
485
|
+
<xsl:param name="target"/>
|
|
486
|
+
<xsl:param name="content"/>
|
|
487
|
+
<xsl:param name="origin"/>
|
|
488
|
+
<xsl:copy-of select="$content"/>
|
|
489
|
+
</xsl:template>
|
|
490
|
+
|
|
491
|
+
<!-- We don't want any permalinks -->
|
|
492
|
+
<xsl:template match="*" mode="permalink"/>
|
|
493
|
+
|
|
494
|
+
<!-- ######## -->
|
|
495
|
+
<!-- Bad Bank -->
|
|
496
|
+
<!-- ######## -->
|
|
497
|
+
|
|
498
|
+
<!-- Reveal.js specific, so best to place inside this stylesheet. -->
|
|
499
|
+
|
|
500
|
+
<!-- A couple of temporary command-line stringparam will just be -->
|
|
501
|
+
<!-- ignored as this stylesheet was first released about the time -->
|
|
502
|
+
<!-- the publisher file came into existence. -->
|
|
503
|
+
|
|
504
|
+
<!-- 2020-02-09: Stopped using a temporary "theme" stringparam -->
|
|
505
|
+
<xsl:param name="theme" select="''"/>
|
|
506
|
+
<!-- 2020-02-09: Stopped using a temporary "local" stringparam -->
|
|
507
|
+
<xsl:param name="local" select="''"/>
|
|
508
|
+
|
|
509
|
+
<xsl:template name="reveal-warnings">
|
|
510
|
+
<xsl:call-template name="banner-warning">
|
|
511
|
+
<xsl:with-param name="warning">Conversion to reveal.js presentations/slideshows is experimental
Requests for additional specific constructions welcome
Additional PreTeXt elements are subject to change</xsl:with-param>
|
|
512
|
+
</xsl:call-template>
|
|
513
|
+
<xsl:if test="not($theme = '')">
|
|
514
|
+
<xsl:message >PTX:WARNING: the temporary "theme" stringparam is deprecated and is being ignored by the conversion to a Reveal.js slideshow. Please switch to using a publisher file to set this option, see documentation in The Guide. The default theme is "simple".</xsl:message>
|
|
515
|
+
<xsl:text>simple</xsl:text>
|
|
516
|
+
</xsl:if>
|
|
517
|
+
<xsl:if test="not($local = '')">
|
|
518
|
+
<xsl:message >PTX:WARNING: the temporary "local" stringparam is deprecated and is being ignored. Please switch to using a publisher file to set this option, see documentation in The Guide. The default behavior is to get resources from a CDN.</xsl:message>
|
|
519
|
+
</xsl:if>
|
|
520
|
+
</xsl:template>
|
|
521
|
+
|
|
522
|
+
</xsl:stylesheet>
|