@pretextbook/pretext-html 0.4.0 → 0.5.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 +86 -1
- package/assets/preview-revealjs.xsl +85 -0
- package/assets/upstream.json +1 -1
- package/assets/xsl/LICENSE-pretext +16 -0
- package/assets/xsl/entities.ent +7 -0
- package/assets/xsl/extract-biblio-csl.xsl +5 -3
- package/assets/xsl/extract-dynamic.xsl +14 -12
- package/assets/xsl/extract-interactive.xsl +2 -2
- package/assets/xsl/extract-pg.xsl +12 -9
- package/assets/xsl/extract-qrcode.xsl +1 -1
- package/assets/xsl/extract-trace.xsl +3 -3
- package/assets/xsl/extract-youtube.xsl +1 -1
- package/assets/xsl/latex/pretext-latex-texstyle.xsl +3 -3
- package/assets/xsl/pretext-assembly.xsl +362 -357
- package/assets/xsl/pretext-braille-preprint.xsl +1 -1
- package/assets/xsl/pretext-common.xsl +101 -90
- package/assets/xsl/pretext-epub.xsl +17 -6
- package/assets/xsl/pretext-fo.xsl +10 -10
- package/assets/xsl/pretext-html.xsl +83 -60
- package/assets/xsl/pretext-latex-common.xsl +8 -8
- package/assets/xsl/pretext-numbers.xsl +35 -35
- package/assets/xsl/pretext-revealjs.xsl +1 -1
- package/assets/xsl/pretext-runestone-fitb.xsl +14 -13
- package/assets/xsl/pretext-runestone-static.xsl +17 -17
- package/assets/xsl/pretext-runestone.xsl +33 -31
- package/assets/xsl/pretext-view-source.xsl +5 -3
- package/assets/xsl/pretext-ww-problem-sets.xsl +6 -1
- package/assets/xsl/publisher-variables.xsl +23 -47
- package/assets/xsl-bundle.json +1 -1
- package/dist/cli-DZsyZERX.js +694 -0
- package/dist/cli.js +1 -1
- package/dist/index.browser.d.ts +5 -0
- package/dist/index.browser.js +402 -256
- package/dist/index.d.ts +5 -0
- package/dist/index.js +23 -18
- package/dist/publication.d.ts +25 -19
- package/dist/renderer.d.ts +48 -0
- package/dist/reveal.d.ts +77 -0
- package/dist/reveal.js +110 -0
- package/dist/target.d.ts +34 -0
- package/package.json +12 -1
- package/dist/cli-Cp6C0sif.js +0 -654
|
@@ -1020,7 +1020,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
1020
1020
|
<!-- to coordinate text and manually inserted tactile versions. -->
|
|
1021
1021
|
<xsl:template match="image" mode="block-title">
|
|
1022
1022
|
<xsl:text>Image: </xsl:text>
|
|
1023
|
-
<xsl:apply-templates select="." mode="
|
|
1023
|
+
<xsl:apply-templates select="." mode="unique-id"/>
|
|
1024
1024
|
<xsl:text>.</xsl:text>
|
|
1025
1025
|
</xsl:template>
|
|
1026
1026
|
|
|
@@ -186,7 +186,10 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
|
|
|
186
186
|
<!-- "book" and "article" are sometimes different, esp. for LaTeX -->
|
|
187
187
|
<xsl:variable name="b-is-book" select="$document-root/self::book" />
|
|
188
188
|
<xsl:variable name="b-is-article" select="$document-root/self::article" />
|
|
189
|
-
<!-- w/, w/o parts induces variants
|
|
189
|
+
<!-- w/, w/o parts induces variants -->
|
|
190
|
+
<!-- NB: computed from the *assembled* root; the version-tree analog, -->
|
|
191
|
+
<!-- $version-has-parts in publisher-variables.xsl, is the -->
|
|
192
|
+
<!-- pre-assembly fact — same concept, deliberately distinct name. -->
|
|
190
193
|
<xsl:variable name="b-has-parts" select="boolean($root/book/part)" />
|
|
191
194
|
|
|
192
195
|
<!-- File extensions can be set globally for a conversion, -->
|
|
@@ -2469,7 +2472,7 @@ Book (with parts), "section" at level 3
|
|
|
2469
2472
|
</xsl:variable>
|
|
2470
2473
|
<xsl:choose>
|
|
2471
2474
|
<xsl:when test="$intermediate='true' or $chunk='true'">
|
|
2472
|
-
<xsl:apply-templates select="." mode="
|
|
2475
|
+
<xsl:apply-templates select="." mode="unique-id" />
|
|
2473
2476
|
<xsl:value-of select="$file-extension" />
|
|
2474
2477
|
</xsl:when>
|
|
2475
2478
|
<!-- Halts since "mathbook" element will be chunk (or earlier) -->
|
|
@@ -2481,7 +2484,7 @@ Book (with parts), "section" at level 3
|
|
|
2481
2484
|
|
|
2482
2485
|
<!-- Context URL -->
|
|
2483
2486
|
<!-- URL for an element on its containing HTML page. -->
|
|
2484
|
-
<!-- Produces: baseurl + containing-filename + "#" +
|
|
2487
|
+
<!-- Produces: baseurl + containing-filename + "#" + unique-id -->
|
|
2485
2488
|
<!-- Empty when no baseurl is configured. -->
|
|
2486
2489
|
<!-- NB: requires $chunk-level and $file-extension to be set -->
|
|
2487
2490
|
<!-- correctly for HTML output (as in extract-qrcode.xsl). -->
|
|
@@ -2490,7 +2493,7 @@ Book (with parts), "section" at level 3
|
|
|
2490
2493
|
<xsl:value-of select="$baseurl"/>
|
|
2491
2494
|
<xsl:apply-templates select="." mode="containing-filename"/>
|
|
2492
2495
|
<xsl:text>#</xsl:text>
|
|
2493
|
-
<xsl:apply-templates select="." mode="
|
|
2496
|
+
<xsl:apply-templates select="." mode="unique-id"/>
|
|
2494
2497
|
</xsl:if>
|
|
2495
2498
|
</xsl:template>
|
|
2496
2499
|
|
|
@@ -3293,7 +3296,7 @@ Book (with parts), "section" at level 3
|
|
|
3293
3296
|
<!-- At any given point in processing, we may want -->
|
|
3294
3297
|
<!-- to know which language is in effect. We look -->
|
|
3295
3298
|
<!-- up the tree for the "closest" indication of a -->
|
|
3296
|
-
<!-- language for localization. The @locale-lang
|
|
3299
|
+
<!-- language for localization. The @pi:locale-lang -->
|
|
3297
3300
|
<!-- attribute is set by the -assembly stylesheet, -->
|
|
3298
3301
|
<!-- and guarantees the language is supported by an -->
|
|
3299
3302
|
<!-- extant localization file. Result is a -->
|
|
@@ -3306,7 +3309,7 @@ Book (with parts), "section" at level 3
|
|
|
3306
3309
|
<!-- $localizations/locale[@language = $lang] -->
|
|
3307
3310
|
|
|
3308
3311
|
<xsl:template match="*" mode="ambient-language">
|
|
3309
|
-
<xsl:value-of select="ancestor-or-self::*[@locale-lang][1]/@locale-lang"/>
|
|
3312
|
+
<xsl:value-of select="ancestor-or-self::*[@pi:locale-lang][1]/@pi:locale-lang"/>
|
|
3310
3313
|
</xsl:template>
|
|
3311
3314
|
|
|
3312
3315
|
<!-- Language direction -->
|
|
@@ -3708,24 +3711,16 @@ Book (with parts), "section" at level 3
|
|
|
3708
3711
|
<!-- Identifiers and Labels -->
|
|
3709
3712
|
<!-- ###################### -->
|
|
3710
3713
|
|
|
3711
|
-
<!--
|
|
3712
|
-
<!--
|
|
3713
|
-
<!--
|
|
3714
|
-
<!--
|
|
3715
|
-
<!--
|
|
3716
|
-
<!--
|
|
3717
|
-
<!--
|
|
3718
|
-
<!--
|
|
3714
|
+
<!-- The "unique-id" is an attribute built during the descent of the -->
|
|
3715
|
+
<!-- tree in the assembly phase, so it is fast to construct and fast -->
|
|
3716
|
+
<!-- to read back. It appears in filenames and URLs when an author -->
|
|
3717
|
+
<!-- has not provided a stable name (an authored "@label" is always -->
|
|
3718
|
+
<!-- preferred for anything a reader manages or shares), and it is -->
|
|
3719
|
+
<!-- not permanent: editing a document can renumber it. A former -->
|
|
3720
|
+
<!-- "visible-id" getter, once a slow reader-facing construction, -->
|
|
3721
|
+
<!-- became an alias of this one and was then retired. -->
|
|
3719
3722
|
<xsl:template match="*" mode="unique-id">
|
|
3720
|
-
<xsl:value-of select="@unique-id"/>
|
|
3721
|
-
</xsl:template>
|
|
3722
|
-
|
|
3723
|
-
<!-- These strings are used for items an author must manage -->
|
|
3724
|
-
<!-- (image files) or that a reader will interact with (shared URLs) -->
|
|
3725
|
-
<!-- Since items like filenames and URLs are sometimes shared across -->
|
|
3726
|
-
<!-- conversions (or extractions) this template is in -common -->
|
|
3727
|
-
<xsl:template match="*" mode="visible-id">
|
|
3728
|
-
<xsl:value-of select="@unique-id"/>
|
|
3723
|
+
<xsl:value-of select="@pi:unique-id"/>
|
|
3729
3724
|
</xsl:template>
|
|
3730
3725
|
|
|
3731
3726
|
<!-- An image described by source code, using languages Asymptote, -->
|
|
@@ -3745,7 +3740,7 @@ Book (with parts), "section" at level 3
|
|
|
3745
3740
|
<!-- @xml:id value was used to form the filename of an image described -->
|
|
3746
3741
|
<!-- by source code (or a default was provided, like image-37). -->
|
|
3747
3742
|
<xsl:when test="parent::image">
|
|
3748
|
-
<xsl:apply-templates select="parent::image" mode="
|
|
3743
|
+
<xsl:apply-templates select="parent::image" mode="unique-id"/>
|
|
3749
3744
|
</xsl:when>
|
|
3750
3745
|
<!-- Well-formed PTX source means we never reach the "otherwise" -->
|
|
3751
3746
|
<xsl:otherwise>
|
|
@@ -3760,8 +3755,8 @@ Book (with parts), "section" at level 3
|
|
|
3760
3755
|
<xsl:template match="pf:prefigure" mode="image-source-basename">
|
|
3761
3756
|
<xsl:choose>
|
|
3762
3757
|
<!-- Determine if @label is authored or generated for backwrd compatibility -->
|
|
3763
|
-
<xsl:when test="not(@authored-label)">
|
|
3764
|
-
<xsl:apply-templates select="." mode="
|
|
3758
|
+
<xsl:when test="not(@pi:authored-label)">
|
|
3759
|
+
<xsl:apply-templates select="." mode="unique-id"/>
|
|
3765
3760
|
<xsl:message>PTX:WARNING: you are encouraged to place a @label attribute on every "prefigure" element. Otherwise, associated image files will have unreliable filenames.</xsl:message>
|
|
3766
3761
|
</xsl:when>
|
|
3767
3762
|
<!-- this @label is now guaranteed to be authored -->
|
|
@@ -3784,21 +3779,23 @@ Book (with parts), "section" at level 3
|
|
|
3784
3779
|
<!-- from an author, which we will dress up here. Notice that this can -->
|
|
3785
3780
|
<!-- change when an author declares a new edition. -->
|
|
3786
3781
|
<xsl:template match="exercise|program|datafile|query|&PROJECT-LIKE;|task|video[@youtube]|exercises|worksheet|interactive[@platform = 'doenetml']|interactive[@iframe]" mode="runestone-id">
|
|
3787
|
-
<!-- With no @xml:id and no @label we realize the author has not given
|
|
3788
|
-
<!-- any thought to a (semi-)peersistent identifire for the Runestone
|
|
3789
|
-
<!-- database. So we call that out as an error. And we do not even
|
|
3790
|
-
<!-- attempt to fallback to an automatically generated string, which
|
|
3791
|
-
<!-- would be malleable over time and editing.
|
|
3792
|
-
<!-- As part of backwards-compatibility, we copy old @xml:id values into
|
|
3793
|
-
<!-- fresh @label. But have an internal @authored-label attribute whose -->
|
|
3794
|
-
<!-- absence alerts us to the copying, which is now not best practice.
|
|
3782
|
+
<!-- With no @xml:id and no @label we realize the author has not given -->
|
|
3783
|
+
<!-- any thought to a (semi-)peersistent identifire for the Runestone -->
|
|
3784
|
+
<!-- database. So we call that out as an error. And we do not even -->
|
|
3785
|
+
<!-- attempt to fallback to an automatically generated string, which -->
|
|
3786
|
+
<!-- would be malleable over time and editing. -->
|
|
3787
|
+
<!-- As part of backwards-compatibility, we copy old @xml:id values into -->
|
|
3788
|
+
<!-- fresh @label. But have an internal @pi:authored-label attribute whose -->
|
|
3789
|
+
<!-- absence alerts us to the copying, which is now not best practice. -->
|
|
3790
|
+
<!-- These messages were disabled 2024-02-20 as unreliable. The cause -->
|
|
3791
|
+
<!-- was a pointer to another component resolving against the authored -->
|
|
3792
|
+
<!-- source, where the @pi:authored-label stamp does not exist; that is -->
|
|
3793
|
+
<!-- repaired, so the messages return. A plain static code listing is -->
|
|
3794
|
+
<!-- the one element reaching here that legitimately has no database -->
|
|
3795
|
+
<!-- identity and needs none, so it is exempt. -->
|
|
3795
3796
|
<xsl:choose>
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
<!-- -->
|
|
3799
|
-
<xsl:when test="true()"/>
|
|
3800
|
-
<!-- -->
|
|
3801
|
-
<xsl:when test="$b-host-runestone and not(@xml:id) and not(@authored-label)">
|
|
3797
|
+
<xsl:when test="self::program and not(@interactive = 'activecode' or @interactive = 'codelens')"/>
|
|
3798
|
+
<xsl:when test="$b-host-runestone and not(@xml:id) and not(@pi:authored-label)">
|
|
3802
3799
|
<xsl:message>
|
|
3803
3800
|
<xsl:text>PTX:ERROR: While building for a Runestone server, a PreTeXt "</xsl:text>
|
|
3804
3801
|
<xsl:value-of select="local-name(.)"/>
|
|
@@ -3812,7 +3809,7 @@ Book (with parts), "section" at level 3
|
|
|
3812
3809
|
</xsl:message>
|
|
3813
3810
|
<xsl:apply-templates select="." mode="location-report"/>
|
|
3814
3811
|
</xsl:when>
|
|
3815
|
-
<xsl:when test="$b-host-runestone and not(@authored-label)">
|
|
3812
|
+
<xsl:when test="$b-host-runestone and not(@pi:authored-label)">
|
|
3816
3813
|
<xsl:message>
|
|
3817
3814
|
<xsl:text>PTX:FALLBACK: While building for a Runestone server, a PreTeXt "</xsl:text>
|
|
3818
3815
|
<xsl:value-of select="local-name(.)"/>
|
|
@@ -3874,7 +3871,7 @@ Book (with parts), "section" at level 3
|
|
|
3874
3871
|
</xsl:template>
|
|
3875
3872
|
|
|
3876
3873
|
<!-- Need a unique filename for codelens traces -->
|
|
3877
|
-
<!--
|
|
3874
|
+
<!-- unique-id can change if an xml:id is added to program for other reasons -->
|
|
3878
3875
|
<!-- Can't vary with build target (so no runestone-id) -->
|
|
3879
3876
|
<!-- Should generally mirror rs-id but without prefix -->
|
|
3880
3877
|
<xsl:template match="program[@interactive = 'codelens']" mode="runestone-codelens-trace-filename">
|
|
@@ -3882,10 +3879,10 @@ Book (with parts), "section" at level 3
|
|
|
3882
3879
|
<!-- If part of exercise-like, use that label, otherwise own -->
|
|
3883
3880
|
<!-- This is an implicit use of &PROJECT-LIKE; and should be kept in sync -->
|
|
3884
3881
|
<xsl:when test="parent::exercise|parent::task|parent::project|parent::activity|parent::exploration|parent::investigation">
|
|
3885
|
-
<xsl:value-of select="../@unique-id"/>
|
|
3882
|
+
<xsl:value-of select="../@pi:unique-id"/>
|
|
3886
3883
|
</xsl:when>
|
|
3887
3884
|
<xsl:otherwise>
|
|
3888
|
-
<xsl:value-of select="@unique-id"/>
|
|
3885
|
+
<xsl:value-of select="@pi:unique-id"/>
|
|
3889
3886
|
</xsl:otherwise>
|
|
3890
3887
|
</xsl:choose>
|
|
3891
3888
|
<xsl:text>.js</xsl:text>
|
|
@@ -3968,8 +3965,8 @@ Book (with parts), "section" at level 3
|
|
|
3968
3965
|
<xsl:param name="to" />
|
|
3969
3966
|
<xsl:variable name="format-code">
|
|
3970
3967
|
<xsl:choose>
|
|
3971
|
-
<xsl:when test="self::node()[@format-code]">
|
|
3972
|
-
<xsl:value-of select="./@format-code" />
|
|
3968
|
+
<xsl:when test="self::node()[@pi:format-code]">
|
|
3969
|
+
<xsl:value-of select="./@pi:format-code" />
|
|
3973
3970
|
</xsl:when>
|
|
3974
3971
|
<xsl:otherwise>1</xsl:otherwise>
|
|
3975
3972
|
</xsl:choose>
|
|
@@ -3986,7 +3983,7 @@ Book (with parts), "section" at level 3
|
|
|
3986
3983
|
<xsl:otherwise><xsl:value-of select="$to" /></xsl:otherwise>
|
|
3987
3984
|
</xsl:choose>
|
|
3988
3985
|
</xsl:variable>
|
|
3989
|
-
<xsl:variable name="original-marker-suffix" select="./@marker-suffix" />
|
|
3986
|
+
<xsl:variable name="original-marker-suffix" select="./@pi:marker-suffix" />
|
|
3990
3987
|
<xsl:variable name="marker-suffix">
|
|
3991
3988
|
<xsl:choose>
|
|
3992
3989
|
<!-- Strip out any trailing dot from the marker format. -->
|
|
@@ -4000,12 +3997,12 @@ Book (with parts), "section" at level 3
|
|
|
4000
3997
|
</xsl:variable>
|
|
4001
3998
|
<xsl:call-template name="formatted-case-cycle">
|
|
4002
3999
|
<xsl:with-param name="from">
|
|
4003
|
-
<xsl:value-of select="./@marker-prefix" />
|
|
4000
|
+
<xsl:value-of select="./@pi:marker-prefix" />
|
|
4004
4001
|
<xsl:number value="$adjusted-from" format="{$format-code}" />
|
|
4005
4002
|
<xsl:value-of select="$marker-suffix" />
|
|
4006
4003
|
</xsl:with-param>
|
|
4007
4004
|
<xsl:with-param name="to">
|
|
4008
|
-
<xsl:value-of select="./@marker-prefix" />
|
|
4005
|
+
<xsl:value-of select="./@pi:marker-prefix" />
|
|
4009
4006
|
<xsl:number value="$adjusted-to" format="{$format-code}" />
|
|
4010
4007
|
<xsl:value-of select="$marker-suffix" />
|
|
4011
4008
|
</xsl:with-param>
|
|
@@ -5672,7 +5669,7 @@ Book (with parts), "section" at level 3
|
|
|
5672
5669
|
<xsl:choose>
|
|
5673
5670
|
<xsl:when test="self::task">project</xsl:when>
|
|
5674
5671
|
<xsl:otherwise>
|
|
5675
|
-
<xsl:value-of select="./@exercise-customization"/>
|
|
5672
|
+
<xsl:value-of select="./@pi:exercise-customization"/>
|
|
5676
5673
|
</xsl:otherwise>
|
|
5677
5674
|
</xsl:choose>
|
|
5678
5675
|
</xsl:variable>
|
|
@@ -6413,7 +6410,7 @@ Book (with parts), "section" at level 3
|
|
|
6413
6410
|
<!-- Printout Margins -->
|
|
6414
6411
|
<!-- ################ -->
|
|
6415
6412
|
|
|
6416
|
-
<xsl:template match="
|
|
6413
|
+
<xsl:template match="&PRINTOUT;" mode="printout-margin">
|
|
6417
6414
|
<xsl:param name="author-side"/>
|
|
6418
6415
|
<xsl:param name="publisher-side"/>
|
|
6419
6416
|
<xsl:choose>
|
|
@@ -7432,7 +7429,7 @@ Book (with parts), "section" at level 3
|
|
|
7432
7429
|
|
|
7433
7430
|
<!-- For a parsons, use @language, default parsons language, or default -->
|
|
7434
7431
|
<!-- programming language in that order of preference. -->
|
|
7435
|
-
<xsl:template match="*[@exercise-interactive = 'parson' or @exercise-interactive = 'parson-horizontal']" mode="get-programming-language">
|
|
7432
|
+
<xsl:template match="*[@pi:exercise-interactive = 'parson' or @pi:exercise-interactive = 'parson-horizontal']" mode="get-programming-language">
|
|
7436
7433
|
<xsl:choose>
|
|
7437
7434
|
<xsl:when test="@language">
|
|
7438
7435
|
<xsl:value-of select="@language" />
|
|
@@ -7448,7 +7445,7 @@ Book (with parts), "section" at level 3
|
|
|
7448
7445
|
|
|
7449
7446
|
<!-- A whole <program> node comes in, -->
|
|
7450
7447
|
<!-- text of ActiveCode name comes out -->
|
|
7451
|
-
<xsl:template match="program|*[@exercise-interactive = 'parson' or @exercise-interactive = 'parson-horizontal']" mode="active-language">
|
|
7448
|
+
<xsl:template match="program|*[@pi:exercise-interactive = 'parson' or @pi:exercise-interactive = 'parson-horizontal']" mode="active-language">
|
|
7452
7449
|
<xsl:variable name="language">
|
|
7453
7450
|
<xsl:apply-templates select="." mode="get-programming-language"/>
|
|
7454
7451
|
</xsl:variable>
|
|
@@ -8403,32 +8400,50 @@ Book (with parts), "section" at level 3
|
|
|
8403
8400
|
<!-- brackets and detail before link manufacture -->
|
|
8404
8401
|
<!-- Content passes with @first, not with @second -->
|
|
8405
8402
|
<xsl:variable name="b-is-biblio-target" select="boolean($target-one/self::biblio)" />
|
|
8406
|
-
<!-- Compose two text parts with an ndash, perhaps
|
|
8403
|
+
<!-- Compose two text parts with an ndash, perhaps wrapped. -->
|
|
8404
|
+
<!-- But custom text replaces the entire composition, so no -->
|
|
8405
|
+
<!-- endpoint texts, no ndash, and no bibliography brackets -->
|
|
8406
|
+
<!-- (matching their suppression for a single citation with -->
|
|
8407
|
+
<!-- custom text). -->
|
|
8407
8408
|
<xsl:variable name="text">
|
|
8408
8409
|
<xsl:if test="parent::mrow">
|
|
8409
8410
|
<xsl:text>\text{</xsl:text>
|
|
8410
8411
|
</xsl:if>
|
|
8411
|
-
<xsl:
|
|
8412
|
-
<xsl:text>
|
|
8413
|
-
|
|
8414
|
-
|
|
8415
|
-
|
|
8416
|
-
|
|
8417
|
-
|
|
8418
|
-
|
|
8419
|
-
|
|
8420
|
-
|
|
8421
|
-
|
|
8422
|
-
|
|
8423
|
-
|
|
8424
|
-
|
|
8425
|
-
|
|
8426
|
-
|
|
8427
|
-
|
|
8428
|
-
|
|
8429
|
-
|
|
8430
|
-
|
|
8431
|
-
|
|
8412
|
+
<xsl:choose>
|
|
8413
|
+
<xsl:when test="$text-style-one = 'custom'">
|
|
8414
|
+
<xsl:apply-templates select="." mode="xref-text" >
|
|
8415
|
+
<xsl:with-param name="target" select="$target-one" />
|
|
8416
|
+
<xsl:with-param name="text-style" select="$text-style-one" />
|
|
8417
|
+
<!-- pass content as an RTF, test vs. empty string, use copy-of -->
|
|
8418
|
+
<xsl:with-param name="custom-text">
|
|
8419
|
+
<xsl:apply-templates/>
|
|
8420
|
+
</xsl:with-param>
|
|
8421
|
+
</xsl:apply-templates>
|
|
8422
|
+
</xsl:when>
|
|
8423
|
+
<xsl:otherwise>
|
|
8424
|
+
<xsl:if test="$b-is-biblio-target">
|
|
8425
|
+
<xsl:text>[</xsl:text>
|
|
8426
|
+
</xsl:if>
|
|
8427
|
+
<xsl:apply-templates select="." mode="xref-text" >
|
|
8428
|
+
<xsl:with-param name="target" select="$target-one" />
|
|
8429
|
+
<xsl:with-param name="text-style" select="$text-style-one" />
|
|
8430
|
+
<!-- pass content as an RTF, test vs. empty string, use copy-of -->
|
|
8431
|
+
<xsl:with-param name="custom-text">
|
|
8432
|
+
<xsl:apply-templates/>
|
|
8433
|
+
</xsl:with-param>
|
|
8434
|
+
</xsl:apply-templates>
|
|
8435
|
+
<xsl:call-template name="character">
|
|
8436
|
+
<xsl:with-param name="name" select="'ndash'"/>
|
|
8437
|
+
</xsl:call-template>
|
|
8438
|
+
<xsl:apply-templates select="." mode="xref-text" >
|
|
8439
|
+
<xsl:with-param name="target" select="$target-two" />
|
|
8440
|
+
<xsl:with-param name="text-style" select="$text-style-two" />
|
|
8441
|
+
</xsl:apply-templates>
|
|
8442
|
+
<xsl:if test="$b-is-biblio-target">
|
|
8443
|
+
<xsl:text>]</xsl:text>
|
|
8444
|
+
</xsl:if>
|
|
8445
|
+
</xsl:otherwise>
|
|
8446
|
+
</xsl:choose>
|
|
8432
8447
|
<xsl:if test="parent::mrow">
|
|
8433
8448
|
<xsl:text>}</xsl:text>
|
|
8434
8449
|
</xsl:if>
|
|
@@ -8652,11 +8667,7 @@ Book (with parts), "section" at level 3
|
|
|
8652
8667
|
<!-- yes/no boolean for valid targets of an "xref" -->
|
|
8653
8668
|
<!-- Initial list from entities file as of 2021-02-10 -->
|
|
8654
8669
|
<!-- Others from test docs, public testing via pretext-dev -->
|
|
8655
|
-
|
|
8656
|
-
<!-- to a one-line "md" but the target is found in the -->
|
|
8657
|
-
<!-- original source and is identified as an "men" element, -->
|
|
8658
|
-
<!-- which really *should not* be not on this list. -->
|
|
8659
|
-
<xsl:template match="&STRUCTURAL;|&DEFINITION-LIKE;|&THEOREM-LIKE;|&PROOF-LIKE;|&AXIOM-LIKE;|&REMARK-LIKE;|&COMPUTATION-LIKE;|&ASIDE-LIKE;|&OPENPROBLEM-LIKE;|&EXAMPLE-LIKE;|&PROJECT-LIKE;|&GOAL-LIKE;|&FIGURE-LIKE;|&SOLUTION-LIKE;|&DISCUSSION-LIKE;|exercise|task|subexercises|exercisegroup|poem|assemblage|paragraphs|li|fn|men|md|mrow|biblio|interactive/instructions|case|contributor|gi" mode="is-xref-target">
|
|
8670
|
+
<xsl:template match="&STRUCTURAL;|&DEFINITION-LIKE;|&THEOREM-LIKE;|&PROOF-LIKE;|&AXIOM-LIKE;|&REMARK-LIKE;|&COMPUTATION-LIKE;|&ASIDE-LIKE;|&OPENPROBLEM-LIKE;|&EXAMPLE-LIKE;|&PROJECT-LIKE;|&GOAL-LIKE;|&FIGURE-LIKE;|&SOLUTION-LIKE;|&DISCUSSION-LIKE;|exercise|task|subexercises|exercisegroup|poem|assemblage|paragraphs|li|fn|md|mrow|biblio|interactive/instructions|case|contributor|gi" mode="is-xref-target">
|
|
8660
8671
|
<xsl:value-of select="'yes'"/>
|
|
8661
8672
|
</xsl:template>
|
|
8662
8673
|
|
|
@@ -8672,15 +8683,15 @@ Book (with parts), "section" at level 3
|
|
|
8672
8683
|
<!-- test/check initial ref of the list -->
|
|
8673
8684
|
<xsl:otherwise>
|
|
8674
8685
|
<xsl:variable name="initial" select="substring-before($ref-list, ' ')" />
|
|
8675
|
-
<!-- Look up the ref in
|
|
8676
|
-
<!--
|
|
8677
|
-
<!--
|
|
8678
|
-
<!--
|
|
8679
|
-
<!--
|
|
8680
|
-
<!--
|
|
8686
|
+
<!-- Look up the ref in the assembled tree: private -->
|
|
8687
|
+
<!-- solutions are merged and versions are resolved, so -->
|
|
8688
|
+
<!-- this is the truthful universe of targets — a ref to -->
|
|
8689
|
+
<!-- content excluded by the version in play is a genuine -->
|
|
8690
|
+
<!-- failure here, and the lookup never needs to survey -->
|
|
8691
|
+
<!-- more than one document. -->
|
|
8681
8692
|
<xsl:variable name="hits">
|
|
8682
|
-
<!--
|
|
8683
|
-
<xsl:for-each select="$
|
|
8693
|
+
<!-- a context shift, so id() searches the assembled tree -->
|
|
8694
|
+
<xsl:for-each select="$root">
|
|
8684
8695
|
<xsl:if test="id($initial)">
|
|
8685
8696
|
<xsl:text>X</xsl:text>
|
|
8686
8697
|
<xsl:variable name="target" select="id($initial)"/>
|
|
@@ -11366,7 +11377,7 @@ http://andrewmccarthy.ie/2014/11/06/swung-dash-in-latex/
|
|
|
11366
11377
|
<xsl:call-template name="deprecation-message">
|
|
11367
11378
|
<xsl:with-param name="occurrences" select=""$docinfo/numbering/figures | $docinfo/numbering/exercises"" />
|
|
11368
11379
|
<xsl:with-param name="date-string" select="'2026-06-07'" />
|
|
11369
|
-
<xsl:with-param name="message" select="'distinct numbering of figure-like and inline exercise blocks has been replaced by the "numbering/figures" and "numbering/exercises" entries in the publisher file
|
|
11380
|
+
<xsl:with-param name="message" select="'distinct numbering of figure-like and inline exercise blocks has been replaced by the "numbering/figures" and "numbering/exercises" entries in the publisher file, and the "docinfo" form is now ignored. Please switch to using the Publishers File for configuration, as documented in the PreTeXt Guide.'"/>
|
|
11370
11381
|
</xsl:call-template>
|
|
11371
11382
|
<!-- -->
|
|
11372
11383
|
<!-- 2017-08-25 once deprecated named lists to be captioned lists -->
|
|
@@ -11424,7 +11435,7 @@ http://andrewmccarthy.ie/2014/11/06/swung-dash-in-latex/
|
|
|
11424
11435
|
<xsl:call-template name="deprecation-message">
|
|
11425
11436
|
<xsl:with-param name="occurrences" select=""$docinfo/numbering/division/@part"" />
|
|
11426
11437
|
<xsl:with-param name="date-string" select="'2021-02-14'" />
|
|
11427
|
-
<xsl:with-param name="message" select="'docinfo/numbering/division/@part has been replaced by the numbering/divisions/@part-structure entry in the publisher file
|
|
11438
|
+
<xsl:with-param name="message" select="'docinfo/numbering/division/@part has been replaced by the numbering/divisions/@part-structure entry in the publisher file, and is now ignored. Please switch to using the Publishers File for configuration, as documented in the PreTeXt Guide.'"/>
|
|
11428
11439
|
</xsl:call-template>
|
|
11429
11440
|
<!-- -->
|
|
11430
11441
|
<!-- 2021-03-17 deprecate worksheet/pagebreak in favor of worksheet/page -->
|
|
@@ -188,7 +188,7 @@
|
|
|
188
188
|
<!-- template in the entry template here, so these pages are not built (good). -->
|
|
189
189
|
<!-- But we do get little buttons to elect a printable version. We have to kill -->
|
|
190
190
|
<!-- those buttons, since EPUB wants to go looking for the printable-version files. -->
|
|
191
|
-
<xsl:template match="
|
|
191
|
+
<xsl:template match="&PRINTOUT;" mode="standalone-printout-links"/>
|
|
192
192
|
|
|
193
193
|
|
|
194
194
|
<!-- ############## -->
|
|
@@ -219,11 +219,13 @@
|
|
|
219
219
|
<xsl:call-template name="packaging-info"/>
|
|
220
220
|
</xsl:template>
|
|
221
221
|
|
|
222
|
-
<!-- First,
|
|
222
|
+
<!-- First, create the cover page and table of contents files, which are -->
|
|
223
|
+
<!-- necessary for every EPUB, even when the source has no "frontmatter" -->
|
|
223
224
|
<!-- We process structural nodes via chunking routine in xsl/mathbook-common.xsl -->
|
|
224
225
|
<!-- This in turn calls specific modal templates defined elsewhere in this file -->
|
|
225
226
|
<xsl:template match="/pretext">
|
|
226
|
-
<xsl:
|
|
227
|
+
<xsl:call-template name="cover-page-file"/>
|
|
228
|
+
<xsl:call-template name="table-contents-file"/>
|
|
227
229
|
<xsl:call-template name="endnotes"/>
|
|
228
230
|
<xsl:apply-templates mode="chunking" />
|
|
229
231
|
</xsl:template>
|
|
@@ -293,7 +295,7 @@
|
|
|
293
295
|
<!-- and they are going into their own files. So it seems the -->
|
|
294
296
|
<!-- right thing to do, while making minimal changes elsewhere. -->
|
|
295
297
|
<xsl:template match="chapter/conclusion|chapter/outcomes[preceding-sibling::section]" mode="containing-filename">
|
|
296
|
-
<xsl:apply-templates select="." mode="
|
|
298
|
+
<xsl:apply-templates select="." mode="unique-id"/>
|
|
297
299
|
<xsl:text>.xhtml</xsl:text>
|
|
298
300
|
</xsl:template>
|
|
299
301
|
|
|
@@ -816,6 +818,12 @@
|
|
|
816
818
|
<!-- Content files -->
|
|
817
819
|
<!-- ############# -->
|
|
818
820
|
|
|
821
|
+
<!-- The cover page and table of contents files are listed in the -->
|
|
822
|
+
<!-- manifest and spine of every EPUB, and "package-manifest" reads -->
|
|
823
|
+
<!-- the table of contents file once written. So create both -->
|
|
824
|
+
<!-- unconditionally: their content comes from the document root, -->
|
|
825
|
+
<!-- not the optional "frontmatter". -->
|
|
826
|
+
|
|
819
827
|
<!-- "coverpage.html" comes in two flavors: -->
|
|
820
828
|
<!-- -->
|
|
821
829
|
<!-- 1. An author provides a cover image via the publication file and -->
|
|
@@ -829,7 +837,7 @@
|
|
|
829
837
|
<!-- here is backed out. More immediately, we build a simple page -->
|
|
830
838
|
<!-- (with CSS) having title, subtitle, and authors. -->
|
|
831
839
|
|
|
832
|
-
<xsl:template
|
|
840
|
+
<xsl:template name="cover-page-file">
|
|
833
841
|
<exsl:document href="{$content-dir}/{$xhtml-dir}/cover-page.xhtml" method="xml" omit-xml-declaration="yes" encoding="UTF-8" indent="no">
|
|
834
842
|
<html>
|
|
835
843
|
<xsl:call-template name="html-theme-attributes"/>
|
|
@@ -878,6 +886,9 @@
|
|
|
878
886
|
</body>
|
|
879
887
|
</html>
|
|
880
888
|
</exsl:document>
|
|
889
|
+
</xsl:template>
|
|
890
|
+
|
|
891
|
+
<xsl:template name="table-contents-file">
|
|
881
892
|
<exsl:document href="{$content-dir}/{$xhtml-dir}/table-contents.xhtml" method="xml" omit-xml-declaration="yes" encoding="UTF-8" indent="no">
|
|
882
893
|
<html xmlns:epub="http://www.idpf.org/2007/ops">
|
|
883
894
|
<xsl:call-template name="html-theme-attributes"/>
|
|
@@ -1553,7 +1564,7 @@
|
|
|
1553
1564
|
|
|
1554
1565
|
<!-- Pluck SVGs from the file full of them, with matching IDs -->
|
|
1555
1566
|
<xsl:template match="m|md[mrow]">
|
|
1556
|
-
<!-- NB: math-representation file writes with "
|
|
1567
|
+
<!-- NB: math-representation file writes with "unique-id" -->
|
|
1557
1568
|
<xsl:variable name="id">
|
|
1558
1569
|
<xsl:apply-templates select="." mode="unique-id"/>
|
|
1559
1570
|
</xsl:variable>
|
|
@@ -610,7 +610,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
610
610
|
</xsl:choose>
|
|
611
611
|
<!-- material following a formatted printout begins a fresh page; -->
|
|
612
612
|
<!-- a conclusion, when present, carries that break itself -->
|
|
613
|
-
<xsl:if test="(
|
|
613
|
+
<xsl:if test="(&PRINTOUT-FILTER;) and $b-latex-worksheet-formatted and not(conclusion)">
|
|
614
614
|
<fo:block break-after="page"/>
|
|
615
615
|
</xsl:if>
|
|
616
616
|
</xsl:template>
|
|
@@ -764,7 +764,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
764
764
|
<xsl:when test="@xml:id = str:tokenize($latex-pagebreaks-string)">
|
|
765
765
|
<xsl:text>page</xsl:text>
|
|
766
766
|
</xsl:when>
|
|
767
|
-
<xsl:when test="(
|
|
767
|
+
<xsl:when test="(&PRINTOUT-FILTER;) and $b-latex-worksheet-formatted">
|
|
768
768
|
<xsl:text>page</xsl:text>
|
|
769
769
|
</xsl:when>
|
|
770
770
|
</xsl:choose>
|
|
@@ -1058,13 +1058,13 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
1058
1058
|
</xsl:template>
|
|
1059
1059
|
|
|
1060
1060
|
<!-- An exercise or project run-in heading. The assembly stamps -->
|
|
1061
|
-
<!-- "@exercise-customization" with the exercise's category; the
|
|
1061
|
+
<!-- "@pi:exercise-customization" with the exercise's category; the -->
|
|
1062
1062
|
<!-- divisional kinds (divisional, worksheet, reading) show a bare -->
|
|
1063
1063
|
<!-- serial number, while an inline exercise or a project carries -->
|
|
1064
1064
|
<!-- the full type-name and number. -->
|
|
1065
1065
|
<xsl:template match="*" mode="exercise-heading">
|
|
1066
1066
|
<xsl:choose>
|
|
1067
|
-
<xsl:when test="@exercise-customization = 'inline' or @exercise-customization = 'project'">
|
|
1067
|
+
<xsl:when test="@pi:exercise-customization = 'inline' or @pi:exercise-customization = 'project'">
|
|
1068
1068
|
<xsl:apply-templates select="." mode="heading-full"/>
|
|
1069
1069
|
</xsl:when>
|
|
1070
1070
|
<xsl:otherwise>
|
|
@@ -2017,23 +2017,23 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
2017
2017
|
</fo:list-item>
|
|
2018
2018
|
</xsl:template>
|
|
2019
2019
|
|
|
2020
|
-
<!-- The assembly stylesheet stamps
|
|
2020
|
+
<!-- The assembly stylesheet stamps each "ol" with @pi:format-code-->
|
|
2021
2021
|
<!-- ('1', 'a', 'A', 'i', 'I', or '0' for a zero-based list), and -->
|
|
2022
|
-
<!-- with @marker-prefix and @marker-suffix adornments, all
|
|
2022
|
+
<!-- with @pi:marker-prefix and @pi:marker-suffix adornments, all -->
|
|
2023
2023
|
<!-- deconstructed from any authored @marker. -->
|
|
2024
2024
|
<xsl:template match="ol/li" mode="list-label">
|
|
2025
2025
|
<xsl:variable name="the-position" select="count(preceding-sibling::li) + 1"/>
|
|
2026
|
-
<xsl:value-of select="parent::ol/@marker-prefix"/>
|
|
2026
|
+
<xsl:value-of select="parent::ol/@pi:marker-prefix"/>
|
|
2027
2027
|
<xsl:choose>
|
|
2028
2028
|
<!-- a zero-based list counts from zero, in arabic numerals -->
|
|
2029
|
-
<xsl:when test="parent::ol/@format-code = '0'">
|
|
2029
|
+
<xsl:when test="parent::ol/@pi:format-code = '0'">
|
|
2030
2030
|
<xsl:number value="$the-position - 1" format="1"/>
|
|
2031
2031
|
</xsl:when>
|
|
2032
2032
|
<xsl:otherwise>
|
|
2033
|
-
<xsl:number value="$the-position" format="{parent::ol/@format-code}"/>
|
|
2033
|
+
<xsl:number value="$the-position" format="{parent::ol/@pi:format-code}"/>
|
|
2034
2034
|
</xsl:otherwise>
|
|
2035
2035
|
</xsl:choose>
|
|
2036
|
-
<xsl:value-of select="parent::ol/@marker-suffix"/>
|
|
2036
|
+
<xsl:value-of select="parent::ol/@pi:marker-suffix"/>
|
|
2037
2037
|
</xsl:template>
|
|
2038
2038
|
|
|
2039
2039
|
<!-- Bullets via the "format-code" machinery of pretext-common.xsl, -->
|