@pretextbook/pretext-html 0.3.0 → 0.4.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 +20 -9
- package/assets/preview-html.xsl +8 -4
- package/assets/upstream.json +1 -1
- package/assets/xsl/README.md +25 -24
- package/assets/xsl/entities.ent +20 -0
- package/assets/xsl/extract-biblio-csl.xsl +1 -1
- package/assets/xsl/extract-pg.xsl +111 -297
- package/assets/xsl/extract-qrcode.xsl +11 -1
- package/assets/xsl/extract-sageplot.xsl +1 -1
- package/assets/xsl/latex/pretext-latex-texstyle.xsl +1 -2
- package/assets/xsl/localizations/README.md +24 -24
- package/assets/xsl/pretext-assembly.xsl +101 -11
- package/assets/xsl/pretext-beamer.xsl +43 -146
- package/assets/xsl/pretext-braille-preprint.xsl +457 -201
- package/assets/xsl/pretext-common.xsl +388 -423
- package/assets/xsl/pretext-epub.xsl +301 -72
- package/assets/xsl/pretext-fo.xsl +70 -86
- package/assets/xsl/pretext-html.xsl +331 -259
- package/assets/xsl/pretext-jupyter.xsl +534 -322
- package/assets/xsl/pretext-latex-classic.xsl +14 -15
- package/assets/xsl/pretext-latex-common.xsl +385 -2389
- package/assets/xsl/pretext-latex.xsl +1995 -5
- package/assets/xsl/pretext-markdown.xsl +919 -0
- package/assets/xsl/pretext-numbers.xsl +22 -4
- package/assets/xsl/pretext-revealjs.xsl +241 -33
- package/assets/xsl/pretext-runestone-fitb.xsl +20 -22
- package/assets/xsl/pretext-runestone.xsl +3 -3
- package/assets/xsl/pretext-sage-doctest.xsl +2 -2
- package/assets/xsl/pretext-text-utilities.xsl +69 -1
- package/assets/xsl/pretext-text.xsl +1077 -107
- package/assets/xsl/publisher-variables.xsl +396 -452
- 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/utilities/report-publisher-variables.xsl +15 -0
- package/assets/xsl-bundle.json +1 -1
- package/dist/{cli-CzoinNle.js → cli-Cp6C0sif.js} +220 -205
- package/dist/cli.js +1 -1
- package/dist/index.browser.js +351 -342
- package/dist/index.js +1 -1
- package/dist/publication.d.ts +9 -1
- package/dist/renderer.d.ts +20 -0
- package/package.json +1 -1
|
@@ -1589,7 +1589,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
1589
1589
|
<!-- tagged table must share a common width (ISO 14289-1). -->
|
|
1590
1590
|
<xsl:template match="exercisegroup">
|
|
1591
1591
|
<!-- the exercises shift right to show the scope of the group, by -->
|
|
1592
|
-
<!-- the shared fraction of the text measure (LaTeX's \
|
|
1592
|
+
<!-- the shared fraction of the text measure (LaTeX's \ptxegindent); -->
|
|
1593
1593
|
<!-- the introduction and conclusion stay at the left margin -->
|
|
1594
1594
|
<xsl:variable name="group-indent" select="format-number($exercisegroup-indentation * $text-width-points, '0.##')"/>
|
|
1595
1595
|
<fo:block>
|
|
@@ -2829,7 +2829,9 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
2829
2829
|
<xsl:for-each select="line">
|
|
2830
2830
|
<fo:block text-align="end">
|
|
2831
2831
|
<xsl:if test="position() = 1">
|
|
2832
|
-
<xsl:call-template name="
|
|
2832
|
+
<xsl:call-template name="character">
|
|
2833
|
+
<xsl:with-param name="name" select="'mdash'"/>
|
|
2834
|
+
</xsl:call-template>
|
|
2833
2835
|
</xsl:if>
|
|
2834
2836
|
<xsl:apply-templates/>
|
|
2835
2837
|
</fo:block>
|
|
@@ -2837,7 +2839,9 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
2837
2839
|
</xsl:when>
|
|
2838
2840
|
<xsl:otherwise>
|
|
2839
2841
|
<fo:block text-align="end">
|
|
2840
|
-
<xsl:call-template name="
|
|
2842
|
+
<xsl:call-template name="character">
|
|
2843
|
+
<xsl:with-param name="name" select="'mdash'"/>
|
|
2844
|
+
</xsl:call-template>
|
|
2841
2845
|
<xsl:apply-templates/>
|
|
2842
2846
|
</fo:block>
|
|
2843
2847
|
</xsl:otherwise>
|
|
@@ -3078,16 +3082,23 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
3078
3082
|
<!-- Side-by-Side -->
|
|
3079
3083
|
<!-- ############ -->
|
|
3080
3084
|
|
|
3081
|
-
<!-- A "sidebyside" lays out its panels horizontally, as an
|
|
3082
|
-
<!-- fo:table with a single row.
|
|
3083
|
-
<!--
|
|
3084
|
-
<!--
|
|
3085
|
-
<!--
|
|
3086
|
-
<!--
|
|
3087
|
-
<!--
|
|
3085
|
+
<!-- A "sidebyside" lays out its panels horizontally, as an -->
|
|
3086
|
+
<!-- fo:table with a single row. The -common "compose-panels" -->
|
|
3087
|
+
<!-- machinery is deliberately unused: XSL-FO has no container that -->
|
|
3088
|
+
<!-- distributes horizontal space over anonymous children, so -->
|
|
3089
|
+
<!-- margins and inter-panel gaps are empty columns and cells -->
|
|
3090
|
+
<!-- interleaved with the panel cells in document order, and each -->
|
|
3091
|
+
<!-- panel cell carries its own vertical alignment. Composition -->
|
|
3092
|
+
<!-- must therefore place structure between the panels, and the -->
|
|
3093
|
+
<!-- -common contract delivers the finished panels as one opaque -->
|
|
3094
|
+
<!-- fragment, the wrong granularity. Only the layout computation -->
|
|
3095
|
+
<!-- is shared: -common "layout-parameters" supplies per-panel -->
|
|
3096
|
+
<!-- widths and vertical alignments, outer margins, and the uniform -->
|
|
3097
|
+
<!-- inter-panel space. The panel vocabulary is the "SBSPANEL" -->
|
|
3098
|
+
<!-- entity. -->
|
|
3088
3099
|
<xsl:template match="sidebyside">
|
|
3089
3100
|
<xsl:apply-templates select="." mode="forced-pagebreak"/>
|
|
3090
|
-
<xsl:variable name="panels" select="
|
|
3101
|
+
<xsl:variable name="panels" select="&SBSPANEL;"/>
|
|
3091
3102
|
<xsl:variable name="rtf-layout">
|
|
3092
3103
|
<xsl:apply-templates select="." mode="layout-parameters"/>
|
|
3093
3104
|
</xsl:variable>
|
|
@@ -3152,9 +3163,9 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
3152
3163
|
</xsl:template>
|
|
3153
3164
|
|
|
3154
3165
|
<!-- A "stack" stacks several items vertically within one panel; -->
|
|
3155
|
-
<!-- the child list
|
|
3166
|
+
<!-- the child list is the "STACKABLE" entity. -->
|
|
3156
3167
|
<xsl:template match="sidebyside/stack">
|
|
3157
|
-
<xsl:apply-templates select="
|
|
3168
|
+
<xsl:apply-templates select="&STACKABLE;"/>
|
|
3158
3169
|
</xsl:template>
|
|
3159
3170
|
|
|
3160
3171
|
<!-- A "sbsgroup" is as pure a container as there can be: the -->
|
|
@@ -3505,19 +3516,26 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
3505
3516
|
</fo:inline>
|
|
3506
3517
|
</xsl:template>
|
|
3507
3518
|
|
|
3508
|
-
<!--
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
<xsl:
|
|
3516
|
-
|
|
3519
|
+
<!-- Most characters read the Unicode code point straight from the -->
|
|
3520
|
+
<!-- representation table in pretext-common.xsl; the code points -->
|
|
3521
|
+
<!-- match the HTML conversion. The exceptions below borrow the -->
|
|
3522
|
+
<!-- symbol font for glyphs missing from the main (serif) face, or -->
|
|
3523
|
+
<!-- are otherwise particular to this conversion. -->
|
|
3524
|
+
<xsl:template match="char" mode="character">
|
|
3525
|
+
<xsl:choose>
|
|
3526
|
+
<xsl:when test="@unicode">
|
|
3527
|
+
<xsl:value-of select="@unicode"/>
|
|
3528
|
+
</xsl:when>
|
|
3529
|
+
<xsl:otherwise>
|
|
3530
|
+
<xsl:call-template name="warn-unimplemented-character">
|
|
3531
|
+
<xsl:with-param name="char-name" select="@name"/>
|
|
3532
|
+
</xsl:call-template>
|
|
3533
|
+
</xsl:otherwise>
|
|
3534
|
+
</xsl:choose>
|
|
3517
3535
|
</xsl:template>
|
|
3518
3536
|
<!-- the thin space is missing from the main (serif) face, so it -->
|
|
3519
3537
|
<!-- borrows the symbol font, as the narrow no-break space does -->
|
|
3520
|
-
<xsl:template name=
|
|
3538
|
+
<xsl:template match="char[@name = 'thin-space']" mode="character">
|
|
3521
3539
|
<fo:inline font-family="{$font-family-symbol}">
|
|
3522
3540
|
<xsl:text> </xsl:text>
|
|
3523
3541
|
</fo:inline>
|
|
@@ -3531,112 +3549,70 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
3531
3549
|
</xsl:template>
|
|
3532
3550
|
<!-- the white square brackets are missing from the main (serif) -->
|
|
3533
3551
|
<!-- face, so they borrow the symbol font, as the tombstone does -->
|
|
3534
|
-
<xsl:template name="
|
|
3552
|
+
<xsl:template match="char[@name = 'ldblbracket']" mode="character">
|
|
3535
3553
|
<fo:inline font-family="{$font-family-symbol}">
|
|
3536
3554
|
<xsl:text>⟦</xsl:text>
|
|
3537
3555
|
</fo:inline>
|
|
3538
3556
|
</xsl:template>
|
|
3539
|
-
<xsl:template name="
|
|
3557
|
+
<xsl:template match="char[@name = 'rdblbracket']" mode="character">
|
|
3540
3558
|
<fo:inline font-family="{$font-family-symbol}">
|
|
3541
3559
|
<xsl:text>⟧</xsl:text>
|
|
3542
3560
|
</fo:inline>
|
|
3543
3561
|
</xsl:template>
|
|
3544
|
-
<!-- the
|
|
3545
|
-
<!--
|
|
3546
|
-
<!--
|
|
3547
|
-
<xsl:template name="
|
|
3562
|
+
<!-- the mathematical angle brackets are missing from the main -->
|
|
3563
|
+
<!-- (serif) face, so they borrow the symbol font, as the -->
|
|
3564
|
+
<!-- tombstone does -->
|
|
3565
|
+
<xsl:template match="char[@name = 'langle']" mode="character">
|
|
3548
3566
|
<fo:inline font-family="{$font-family-symbol}">
|
|
3549
3567
|
<xsl:text>⟨</xsl:text>
|
|
3550
3568
|
</fo:inline>
|
|
3551
3569
|
</xsl:template>
|
|
3552
|
-
<xsl:template name="
|
|
3570
|
+
<xsl:template match="char[@name = 'rangle']" mode="character">
|
|
3553
3571
|
<fo:inline font-family="{$font-family-symbol}">
|
|
3554
3572
|
<xsl:text>⟩</xsl:text>
|
|
3555
3573
|
</fo:inline>
|
|
3556
3574
|
</xsl:template>
|
|
3557
|
-
<xsl:template name="ellipsis-character">
|
|
3558
|
-
<xsl:text>…</xsl:text>
|
|
3559
|
-
</xsl:template>
|
|
3560
|
-
<xsl:template name="midpoint-character">
|
|
3561
|
-
<xsl:text>·</xsl:text>
|
|
3562
|
-
</xsl:template>
|
|
3563
3575
|
<!-- the swung dash is missing from the main (serif) face, so it -->
|
|
3564
3576
|
<!-- borrows the symbol font, as the tombstone does -->
|
|
3565
|
-
<xsl:template name="
|
|
3577
|
+
<xsl:template match="char[@name = 'swungdash']" mode="character">
|
|
3566
3578
|
<fo:inline font-family="{$font-family-symbol}">
|
|
3567
3579
|
<xsl:text>⁓</xsl:text>
|
|
3568
3580
|
</fo:inline>
|
|
3569
3581
|
</xsl:template>
|
|
3570
|
-
<xsl:template name="permille-character">
|
|
3571
|
-
<xsl:text>‰</xsl:text>
|
|
3572
|
-
</xsl:template>
|
|
3573
|
-
<xsl:template name="pilcrow-character">
|
|
3574
|
-
<xsl:text>¶</xsl:text>
|
|
3575
|
-
</xsl:template>
|
|
3576
|
-
<xsl:template name="section-mark-character">
|
|
3577
|
-
<xsl:text>§</xsl:text>
|
|
3578
|
-
</xsl:template>
|
|
3579
|
-
<xsl:template name="minus-character">
|
|
3580
|
-
<xsl:text>−</xsl:text>
|
|
3581
|
-
</xsl:template>
|
|
3582
|
-
<xsl:template name="times-character">
|
|
3583
|
-
<xsl:text>×</xsl:text>
|
|
3584
|
-
</xsl:template>
|
|
3585
|
-
<xsl:template name="solidus-character">
|
|
3586
|
-
<xsl:text>⁄</xsl:text>
|
|
3587
|
-
</xsl:template>
|
|
3588
|
-
<xsl:template name="obelus-character">
|
|
3589
|
-
<xsl:text>÷</xsl:text>
|
|
3590
|
-
</xsl:template>
|
|
3591
|
-
<xsl:template name="plusminus-character">
|
|
3592
|
-
<xsl:text>±</xsl:text>
|
|
3593
|
-
</xsl:template>
|
|
3594
|
-
<xsl:template name="copyright-character">
|
|
3595
|
-
<xsl:text>©</xsl:text>
|
|
3596
|
-
</xsl:template>
|
|
3597
3582
|
<!-- the sound-recording and service marks borrow the symbol font -->
|
|
3598
|
-
<xsl:template name="
|
|
3583
|
+
<xsl:template match="char[@name = 'phonomark']" mode="character">
|
|
3599
3584
|
<fo:inline font-family="{$font-family-symbol}">
|
|
3600
3585
|
<xsl:text>℗</xsl:text>
|
|
3601
3586
|
</fo:inline>
|
|
3602
3587
|
</xsl:template>
|
|
3588
|
+
<xsl:template match="char[@name = 'servicemark']" mode="character">
|
|
3589
|
+
<fo:inline font-family="{$font-family-symbol}">
|
|
3590
|
+
<xsl:text>℠</xsl:text>
|
|
3591
|
+
</fo:inline>
|
|
3592
|
+
</xsl:template>
|
|
3603
3593
|
<!-- The copyleft symbol (U+1F12F) is in no embeddable font, so it -->
|
|
3604
3594
|
<!-- is built, as in its name, from a reversed "c" (U+2184) set in -->
|
|
3605
3595
|
<!-- parentheses. The main font lacks the reversed "c", and it sits -->
|
|
3606
3596
|
<!-- between the parentheses with no surrounding space, so it is -->
|
|
3607
3597
|
<!-- named from the symbol font explicitly, as the primes are. -->
|
|
3608
|
-
<xsl:template name="
|
|
3598
|
+
<xsl:template match="char[@name = 'copyleft']" mode="character">
|
|
3609
3599
|
<xsl:text>(</xsl:text>
|
|
3610
3600
|
<fo:inline font-family="{$font-family-symbol}">
|
|
3611
3601
|
<xsl:text>ↄ</xsl:text>
|
|
3612
3602
|
</fo:inline>
|
|
3613
3603
|
<xsl:text>)</xsl:text>
|
|
3614
3604
|
</xsl:template>
|
|
3615
|
-
<xsl:template name="registered-character">
|
|
3616
|
-
<xsl:text>®</xsl:text>
|
|
3617
|
-
</xsl:template>
|
|
3618
|
-
<xsl:template name="trademark-character">
|
|
3619
|
-
<xsl:text>™</xsl:text>
|
|
3620
|
-
</xsl:template>
|
|
3621
|
-
<xsl:template name="servicemark-character">
|
|
3622
|
-
<fo:inline font-family="{$font-family-symbol}">
|
|
3623
|
-
<xsl:text>℠</xsl:text>
|
|
3624
|
-
</fo:inline>
|
|
3625
|
-
</xsl:template>
|
|
3626
|
-
<xsl:template name="degree-character">
|
|
3627
|
-
<xsl:text>°</xsl:text>
|
|
3628
|
-
</xsl:template>
|
|
3629
3605
|
<!-- the prime and double prime (minutes and seconds, feet and -->
|
|
3630
3606
|
<!-- inches) are missing from the main (serif) face; because they -->
|
|
3631
3607
|
<!-- sit *within* a measurement, with no surrounding space, FOP's -->
|
|
3632
3608
|
<!-- per-word font selection cannot reach the symbol font for them, -->
|
|
3633
3609
|
<!-- so each is named explicitly, as the tombstone is. -->
|
|
3634
|
-
<xsl:template name="
|
|
3610
|
+
<xsl:template match="char[@name = 'prime']" mode="character">
|
|
3635
3611
|
<fo:inline font-family="{$font-family-symbol}">
|
|
3636
3612
|
<xsl:text>′</xsl:text>
|
|
3637
3613
|
</fo:inline>
|
|
3638
3614
|
</xsl:template>
|
|
3639
|
-
<xsl:template name="
|
|
3615
|
+
<xsl:template match="char[@name = 'dblprime']" mode="character">
|
|
3640
3616
|
<fo:inline font-family="{$font-family-symbol}">
|
|
3641
3617
|
<xsl:text>″</xsl:text>
|
|
3642
3618
|
</fo:inline>
|
|
@@ -4244,11 +4220,15 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
4244
4220
|
<fo:block space-before="1em" space-after="1em">
|
|
4245
4221
|
<xsl:apply-templates select="." mode="link-id-attribute"/>
|
|
4246
4222
|
<fo:block>
|
|
4247
|
-
<xsl:call-template name="
|
|
4223
|
+
<xsl:call-template name="character">
|
|
4224
|
+
<xsl:with-param name="name" select="'langle'"/>
|
|
4225
|
+
</xsl:call-template>
|
|
4248
4226
|
<xsl:apply-templates select="." mode="number"/>
|
|
4249
4227
|
<xsl:text> </xsl:text>
|
|
4250
4228
|
<xsl:apply-templates select="." mode="title-full"/>
|
|
4251
|
-
<xsl:call-template name="
|
|
4229
|
+
<xsl:call-template name="character">
|
|
4230
|
+
<xsl:with-param name="name" select="'rangle'"/>
|
|
4231
|
+
</xsl:call-template>
|
|
4252
4232
|
<xsl:text> </xsl:text>
|
|
4253
4233
|
<xsl:text>≡</xsl:text>
|
|
4254
4234
|
</fo:block>
|
|
@@ -4286,7 +4266,9 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
4286
4266
|
<xsl:apply-templates select="$target" mode="unique-id"/>
|
|
4287
4267
|
</xsl:variable>
|
|
4288
4268
|
<fo:block start-indent="2em">
|
|
4289
|
-
<xsl:call-template name="
|
|
4269
|
+
<xsl:call-template name="character">
|
|
4270
|
+
<xsl:with-param name="name" select="'langle'"/>
|
|
4271
|
+
</xsl:call-template>
|
|
4290
4272
|
<xsl:apply-templates select="$target" mode="title-full"/>
|
|
4291
4273
|
<xsl:text> </xsl:text>
|
|
4292
4274
|
<fo:inline font-size="70%">
|
|
@@ -4298,7 +4280,9 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
4298
4280
|
</fo:basic-link>
|
|
4299
4281
|
<xsl:text>]</xsl:text>
|
|
4300
4282
|
</fo:inline>
|
|
4301
|
-
<xsl:call-template name="
|
|
4283
|
+
<xsl:call-template name="character">
|
|
4284
|
+
<xsl:with-param name="name" select="'rangle'"/>
|
|
4285
|
+
</xsl:call-template>
|
|
4302
4286
|
</fo:block>
|
|
4303
4287
|
</xsl:template>
|
|
4304
4288
|
|