@pretextbook/pretext-html 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -2
- package/assets/preview-html.xsl +16 -0
- package/assets/upstream.json +1 -1
- package/assets/xsl/README.md +25 -24
- package/assets/xsl/entities.ent +11 -0
- package/assets/xsl/extract-dynamic.xsl +54 -3
- package/assets/xsl/extract-gdscript.xsl +61 -0
- package/assets/xsl/extract-sageplot.xsl +3 -0
- package/assets/xsl/localizations/README.md +24 -24
- package/assets/xsl/localizations/it-IT.xml +37 -41
- package/assets/xsl/pretext-assembly.xsl +190 -30
- package/assets/xsl/pretext-beamer.xsl +57 -12
- package/assets/xsl/pretext-common.xsl +175 -30
- package/assets/xsl/pretext-epub.xsl +4 -6
- package/assets/xsl/pretext-fo.xsl +127 -67
- package/assets/xsl/pretext-html.xsl +350 -94
- package/assets/xsl/pretext-jupyter.xsl +1 -0
- package/assets/xsl/pretext-latex-classic.xsl +2 -2
- package/assets/xsl/pretext-latex-common.xsl +296 -151
- package/assets/xsl/pretext-latex.xsl +16 -6
- package/assets/xsl/pretext-numbers.xsl +10 -0
- package/assets/xsl/pretext-revealjs.xsl +69 -4
- package/assets/xsl/pretext-runestone-fitb.xsl +179 -84
- package/assets/xsl/pretext-runestone-static.xsl +72 -20
- package/assets/xsl/pretext-runestone.xsl +32 -25
- package/assets/xsl/pretext-text-utilities.xsl +7 -0
- package/assets/xsl/pretext-text.xsl +17 -0
- package/assets/xsl/publisher-variables.xsl +109 -111
- package/assets/xsl/support/play-button/README.md +1 -3
- package/assets/xsl/tests/README.md +1 -1
- package/assets/xsl/utilities/README.md +6 -8
- package/assets/xsl-bundle.json +1 -1
- package/dist/cli-BUrNZxov.js +1098 -0
- package/dist/cli.js +1 -1
- package/dist/html-static.d.ts +20 -0
- package/dist/index.browser.js +598 -374
- package/dist/index.d.ts +4 -0
- package/dist/index.js +35 -30
- package/dist/renderer.d.ts +40 -1
- package/dist/skeleton.d.ts +41 -0
- package/dist/xrefs.d.ts +54 -0
- package/package.json +2 -1
- package/dist/cli-D0m0Ha1j.js +0 -856
|
@@ -586,7 +586,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
586
586
|
<!-- section-level items in the back matter -->
|
|
587
587
|
<xsl:template name="titlesec-section-style">
|
|
588
588
|
<xsl:text>\titleformat{\section}[hang]
</xsl:text>
|
|
589
|
-
<xsl:text>{\divisionfont\Large\bfseries}{\thesection}{1ex}{#1}
</xsl:text>
|
|
589
|
+
<xsl:text>{\divisionfont\Large\bfseries}{\thesection\ptxappendixperiodsection}{1ex}{#1}
</xsl:text>
|
|
590
590
|
<xsl:text>[{\large\authorsptx}]
</xsl:text>
|
|
591
591
|
<xsl:text>\titleformat{name=\section,numberless}[block]
</xsl:text>
|
|
592
592
|
<xsl:text>{\divisionfont\Large\bfseries}{}{0pt}{#1}
</xsl:text>
|
|
@@ -656,16 +656,24 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
656
656
|
<xsl:template name="titletoc-chapter-style">
|
|
657
657
|
<xsl:text>\titlecontents{chapter}%
</xsl:text>
|
|
658
658
|
<xsl:text>[0pt]{\contentsmargin{0em}\addvspace{1pc}\contentsfont\bfseries}%
</xsl:text>
|
|
659
|
-
<xsl:text>{\large\thecontentslabel\enspace}{\large}%
</xsl:text>
|
|
659
|
+
<xsl:text>{\large\thecontentslabel\ptxappendixperiodchapter\enspace}{\large}%
</xsl:text>
|
|
660
660
|
<xsl:text>{\hfill\bfseries\thecontentspage}%
</xsl:text>
|
|
661
661
|
<xsl:text>[\addvspace{.5pc}]%
</xsl:text>
|
|
662
662
|
</xsl:template>
|
|
663
663
|
|
|
664
664
|
<!-- The indent, and space for the number/label are straight -->
|
|
665
665
|
<!-- from the titletoc documentation, which says they match -->
|
|
666
|
-
<!-- the LaTeX book class
|
|
666
|
+
<!-- the LaTeX book class. The top-level division of an -->
|
|
667
|
+
<!-- article is a section, so the \dottedcontents shorthand -->
|
|
668
|
+
<!-- is expanded verbatim to the \titlecontents form it -->
|
|
669
|
+
<!-- abbreviates, exposing the label composition to carry the -->
|
|
670
|
+
<!-- appendix-period seam -->
|
|
667
671
|
<xsl:template name="titletoc-section-style">
|
|
668
|
-
<xsl:text>\
|
|
672
|
+
<xsl:text>\titlecontents{section}%
</xsl:text>
|
|
673
|
+
<xsl:text>[3.8em]{\contentsfont}%
</xsl:text>
|
|
674
|
+
<xsl:text>{\contentslabel[\thecontentslabel\ptxappendixperiodsection]{2.3em}}%
</xsl:text>
|
|
675
|
+
<xsl:text>{\hspace*{-2.3em}}%
</xsl:text>
|
|
676
|
+
<xsl:text>{\titlerule*[1pc]{.}\contentspage}%
</xsl:text>
|
|
669
677
|
</xsl:template>
|
|
670
678
|
|
|
671
679
|
<!-- The indent, and space for the number/label are straight -->
|
|
@@ -1009,12 +1017,14 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
1009
1017
|
<xsl:text>%% end: copyright-page
</xsl:text>
|
|
1010
1018
|
</xsl:template>
|
|
1011
1019
|
|
|
1012
|
-
<!-- Only for a book with a colophon, we put the statement of support
|
|
1020
|
+
<!-- Only for a book with a colophon, we put the statement of support -->
|
|
1021
|
+
<!-- at the bottom of the colophon. The schema says a "support" -->
|
|
1022
|
+
<!-- statement is text-level, mixed content -->
|
|
1013
1023
|
<xsl:template match="bibinfo/support" mode="copyright-page">
|
|
1014
1024
|
<xsl:text>%% Funding/Support statement:</xsl:text>
|
|
1015
1025
|
<xsl:text>\par\medskip
</xsl:text>
|
|
1016
1026
|
<xsl:text>\noindent{}</xsl:text>
|
|
1017
|
-
<xsl:apply-templates select="
|
|
1027
|
+
<xsl:apply-templates select="node()"/>
|
|
1018
1028
|
<xsl:text>\par
</xsl:text>
|
|
1019
1029
|
<xsl:text>\vspace*{\stretch{1}}
</xsl:text>
|
|
1020
1030
|
</xsl:template>
|
|
@@ -810,6 +810,16 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
810
810
|
<!-- Full Numbers -->
|
|
811
811
|
<!-- -->
|
|
812
812
|
|
|
813
|
+
<!-- The "number" of a table note ("tn") is its letter: a, b, c, -->
|
|
814
|
+
<!-- assigned per-"tabular" in document order of the marks, which is -->
|
|
815
|
+
<!-- reading order (Notes to tables: CMoS 18th ed., 3.77-3.81; -->
|
|
816
|
+
<!-- specific notes at 3.80). One computation, consumed by every -->
|
|
817
|
+
<!-- conversion, and deliberately disjoint from the numbering of -->
|
|
818
|
+
<!-- true footnotes. -->
|
|
819
|
+
<xsl:template match="tabular//tn" mode="number">
|
|
820
|
+
<xsl:number level="any" from="tabular" format="a"/>
|
|
821
|
+
</xsl:template>
|
|
822
|
+
|
|
813
823
|
<!-- Now trivial, the container structure plus the serial. -->
|
|
814
824
|
<!-- We condition on empty serial number in order to create -->
|
|
815
825
|
<!-- empty full numbers. This is where we add separator, -->
|
|
@@ -165,6 +165,19 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
165
165
|
<xsl:text>span.mjpage { display: inline; }
</xsl:text>
|
|
166
166
|
<xsl:text>span.mjpage__block { display: block; text-align: center; margin: 0.5em 0; }
</xsl:text>
|
|
167
167
|
</xsl:if>
|
|
168
|
+
<!-- Vertical alignment of slides diverging from the -->
|
|
169
|
+
<!-- document-wide default. reveal.js absolutely -->
|
|
170
|
+
<!-- positions each slide, and when configured to center -->
|
|
171
|
+
<!-- ("center: true") it computes an inline "top" offset, -->
|
|
172
|
+
<!-- which only "!important" can overrule. A top-aligned -->
|
|
173
|
+
<!-- slide just pins that offset to zero. Middle and -->
|
|
174
|
+
<!-- bottom alignment stretch the slide to the full frame -->
|
|
175
|
+
<!-- and place its content by flexbox; the "display" rule -->
|
|
176
|
+
<!-- is confined to the "present" slide so hidden slides -->
|
|
177
|
+
<!-- retain "display: none". -->
|
|
178
|
+
<xsl:text>.reveal .slides section.valign-top { top: 0 !important; }
</xsl:text>
|
|
179
|
+
<xsl:text>.reveal .slides section.valign-middle.present { display: flex !important; flex-direction: column; justify-content: center; top: 0 !important; height: 100% !important; }
</xsl:text>
|
|
180
|
+
<xsl:text>.reveal .slides section.valign-bottom.present { display: flex !important; flex-direction: column; justify-content: flex-end; top: 0 !important; height: 100% !important; }
</xsl:text>
|
|
168
181
|
</style>
|
|
169
182
|
<!-- no diagcess machinery with embedded mathematics: an -->
|
|
170
183
|
<!-- annotated PreFigure diagram is then a static image -->
|
|
@@ -238,7 +251,20 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
238
251
|
<xsl:value-of select="$reveal-navigation-mode"/>
|
|
239
252
|
<xsl:text>',
</xsl:text>
|
|
240
253
|
<xsl:text> progress: false,
</xsl:text>
|
|
241
|
-
|
|
254
|
+
<!-- reveal.js "center" vertically centers every slide, -->
|
|
255
|
+
<!-- so it realizes a document-wide "middle" default; -->
|
|
256
|
+
<!-- a "top" or "bottom" default disables it, and slides -->
|
|
257
|
+
<!-- diverging from the default get a class instead -->
|
|
258
|
+
<xsl:text> center: </xsl:text>
|
|
259
|
+
<xsl:choose>
|
|
260
|
+
<xsl:when test="$slides-valign-default = 'middle'">
|
|
261
|
+
<xsl:text>true</xsl:text>
|
|
262
|
+
</xsl:when>
|
|
263
|
+
<xsl:otherwise>
|
|
264
|
+
<xsl:text>false</xsl:text>
|
|
265
|
+
</xsl:otherwise>
|
|
266
|
+
</xsl:choose>
|
|
267
|
+
<xsl:text>,
</xsl:text>
|
|
242
268
|
<xsl:text> hash: true,
</xsl:text>
|
|
243
269
|
<xsl:text> transition: 'fade',
</xsl:text>
|
|
244
270
|
<xsl:text> width: "100%",
</xsl:text>
|
|
@@ -283,6 +309,30 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
283
309
|
</html>
|
|
284
310
|
</xsl:template>
|
|
285
311
|
|
|
312
|
+
<!-- reveal.js natively places content at the middle of a slide -->
|
|
313
|
+
<!-- when centering (a "middle" default) and at the top -->
|
|
314
|
+
<!-- otherwise. Any other placement gets a class tied to the -->
|
|
315
|
+
<!-- style rules above. -->
|
|
316
|
+
<xsl:template name="valign-class">
|
|
317
|
+
<xsl:param name="valign"/>
|
|
318
|
+
<xsl:variable name="native">
|
|
319
|
+
<xsl:choose>
|
|
320
|
+
<xsl:when test="$slides-valign-default = 'middle'">
|
|
321
|
+
<xsl:text>middle</xsl:text>
|
|
322
|
+
</xsl:when>
|
|
323
|
+
<xsl:otherwise>
|
|
324
|
+
<xsl:text>top</xsl:text>
|
|
325
|
+
</xsl:otherwise>
|
|
326
|
+
</xsl:choose>
|
|
327
|
+
</xsl:variable>
|
|
328
|
+
<xsl:if test="not($valign = $native)">
|
|
329
|
+
<xsl:attribute name="class">
|
|
330
|
+
<xsl:text>valign-</xsl:text>
|
|
331
|
+
<xsl:value-of select="$valign"/>
|
|
332
|
+
</xsl:attribute>
|
|
333
|
+
</xsl:if>
|
|
334
|
+
</xsl:template>
|
|
335
|
+
|
|
286
336
|
<!-- A "section" contains multiple "slide", which we process, -->
|
|
287
337
|
<!-- but first we make a special slide announcing the "section" -->
|
|
288
338
|
<!-- With reveal.js navigationMode set to "default" or "grid" -->
|
|
@@ -297,6 +347,9 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
297
347
|
<xsl:when test="($reveal-navigation-mode = 'default') or ($reveal-navigation-mode = 'grid')">
|
|
298
348
|
<section>
|
|
299
349
|
<section>
|
|
350
|
+
<xsl:call-template name="valign-class">
|
|
351
|
+
<xsl:with-param name="valign" select="$slides-valign-default"/>
|
|
352
|
+
</xsl:call-template>
|
|
300
353
|
<h2>
|
|
301
354
|
<xsl:apply-templates select="." mode="title-full"/>
|
|
302
355
|
</h2>
|
|
@@ -306,6 +359,9 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
306
359
|
</xsl:when>
|
|
307
360
|
<xsl:when test="$reveal-navigation-mode = 'linear'">
|
|
308
361
|
<section>
|
|
362
|
+
<xsl:call-template name="valign-class">
|
|
363
|
+
<xsl:with-param name="valign" select="$slides-valign-default"/>
|
|
364
|
+
</xsl:call-template>
|
|
309
365
|
<h2>
|
|
310
366
|
<xsl:apply-templates select="." mode="title-full"/>
|
|
311
367
|
</h2>
|
|
@@ -321,6 +377,9 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
321
377
|
<xsl:template match="frontmatter">
|
|
322
378
|
<section>
|
|
323
379
|
<section>
|
|
380
|
+
<xsl:call-template name="valign-class">
|
|
381
|
+
<xsl:with-param name="valign" select="$slides-valign-default"/>
|
|
382
|
+
</xsl:call-template>
|
|
324
383
|
<!-- we assume an overall title exists -->
|
|
325
384
|
<h1>
|
|
326
385
|
<xsl:apply-templates select="$root/slideshow" mode="title-full" />
|
|
@@ -372,6 +431,9 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
372
431
|
|
|
373
432
|
<xsl:template match="abstract">
|
|
374
433
|
<section>
|
|
434
|
+
<xsl:call-template name="valign-class">
|
|
435
|
+
<xsl:with-param name="valign" select="$slides-valign-default"/>
|
|
436
|
+
</xsl:call-template>
|
|
375
437
|
<h2>Abstract</h2>
|
|
376
438
|
<div align="left">
|
|
377
439
|
<xsl:apply-templates select="*"/>
|
|
@@ -381,6 +443,11 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
381
443
|
|
|
382
444
|
<xsl:template match="slide">
|
|
383
445
|
<section>
|
|
446
|
+
<xsl:call-template name="valign-class">
|
|
447
|
+
<xsl:with-param name="valign">
|
|
448
|
+
<xsl:apply-templates select="." mode="valign"/>
|
|
449
|
+
</xsl:with-param>
|
|
450
|
+
</xsl:call-template>
|
|
384
451
|
<xsl:variable name="slide-hN">
|
|
385
452
|
<xsl:apply-templates select="." mode="hN">
|
|
386
453
|
<xsl:with-param name="heading-level" select="$reveal-slide-heading-level"/>
|
|
@@ -633,9 +700,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
633
700
|
<xsl:when test="$b-reveal-embedded-math">
|
|
634
701
|
<xsl:variable name="base-pathname">
|
|
635
702
|
<xsl:value-of select="$generated-directory"/>
|
|
636
|
-
<xsl:
|
|
637
|
-
<xsl:text>prefigure/</xsl:text>
|
|
638
|
-
</xsl:if>
|
|
703
|
+
<xsl:text>prefigure/</xsl:text>
|
|
639
704
|
<xsl:apply-templates select="pf:prefigure" mode="image-source-basename"/>
|
|
640
705
|
</xsl:variable>
|
|
641
706
|
<xsl:apply-templates select="." mode="svg-png-wrapper">
|