@pretextbook/pretext-html 0.4.0 → 0.6.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.
Files changed (44) hide show
  1. package/README.md +92 -1
  2. package/assets/preview-html.xsl +14 -0
  3. package/assets/preview-revealjs.xsl +85 -0
  4. package/assets/upstream.json +1 -1
  5. package/assets/xsl/LICENSE-pretext +16 -0
  6. package/assets/xsl/entities.ent +7 -0
  7. package/assets/xsl/extract-biblio-csl.xsl +5 -3
  8. package/assets/xsl/extract-dynamic.xsl +14 -12
  9. package/assets/xsl/extract-interactive.xsl +2 -2
  10. package/assets/xsl/extract-pg.xsl +12 -9
  11. package/assets/xsl/extract-qrcode.xsl +1 -1
  12. package/assets/xsl/extract-trace.xsl +3 -3
  13. package/assets/xsl/extract-youtube.xsl +1 -1
  14. package/assets/xsl/latex/pretext-latex-texstyle.xsl +3 -3
  15. package/assets/xsl/pretext-assembly.xsl +362 -357
  16. package/assets/xsl/pretext-braille-preprint.xsl +1 -1
  17. package/assets/xsl/pretext-common.xsl +101 -90
  18. package/assets/xsl/pretext-epub.xsl +17 -6
  19. package/assets/xsl/pretext-fo.xsl +10 -10
  20. package/assets/xsl/pretext-html.xsl +83 -60
  21. package/assets/xsl/pretext-latex-common.xsl +8 -8
  22. package/assets/xsl/pretext-numbers.xsl +35 -35
  23. package/assets/xsl/pretext-revealjs.xsl +1 -1
  24. package/assets/xsl/pretext-runestone-fitb.xsl +14 -13
  25. package/assets/xsl/pretext-runestone-static.xsl +17 -17
  26. package/assets/xsl/pretext-runestone.xsl +33 -31
  27. package/assets/xsl/pretext-view-source.xsl +5 -3
  28. package/assets/xsl/pretext-ww-problem-sets.xsl +6 -1
  29. package/assets/xsl/publisher-variables.xsl +23 -47
  30. package/assets/xsl-bundle.json +1 -1
  31. package/dist/cli-DF7XOWN7.js +724 -0
  32. package/dist/cli.js +1 -1
  33. package/dist/index.browser.d.ts +6 -0
  34. package/dist/index.browser.js +501 -332
  35. package/dist/index.d.ts +6 -0
  36. package/dist/index.js +25 -19
  37. package/dist/knowls.d.ts +43 -0
  38. package/dist/publication.d.ts +25 -19
  39. package/dist/renderer.d.ts +61 -0
  40. package/dist/reveal.d.ts +77 -0
  41. package/dist/reveal.js +110 -0
  42. package/dist/target.d.ts +34 -0
  43. package/package.json +12 -1
  44. package/dist/cli-Cp6C0sif.js +0 -654
@@ -123,18 +123,15 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
123
123
  <!-- the document type is the element being converted -->
124
124
  <xsl:variable name="version-doc-type" select="local-name($version-document-root)"/>
125
125
 
126
- <!-- N.B. consumers disagree on which section-like elements make an -->
127
- <!-- article "sectioned": numbering counts "worksheet", chunking -->
128
- <!-- does not, and the table of contents also counts "handout". -->
129
- <!-- The facts preserve those historical memberships. -->
130
- <!-- TODO: harmonize the memberships — a deliberate, -->
131
- <!-- behavior-changing design decision, deferred -->
126
+ <!-- An article is "sectioned" for every structure-driven default -->
127
+ <!-- below when it has a "section", a "worksheet", or a "handout": -->
128
+ <!-- the three are peers at the same level, so a workbook of -->
129
+ <!-- printouts numbers and chunks as a sectioned article does. -->
132
130
  <xsl:variable name="version-has-parts" select="boolean($version-root/book/part)"/>
133
131
  <xsl:variable name="version-book-chapters" select="boolean($version-root/book/part/chapter|$version-root/book/chapter)"/>
134
132
  <xsl:variable name="version-book-sections" select="boolean($version-root/book/part/chapter/section|$version-root/book/chapter/section)"/>
135
133
  <xsl:variable name="version-article-sections" select="boolean($version-root/article/section)"/>
136
- <xsl:variable name="version-article-worksheets" select="boolean($version-root/article/worksheet)"/>
137
- <xsl:variable name="version-article-handouts" select="boolean($version-root/article/handout)"/>
134
+ <xsl:variable name="version-article-printouts" select="boolean($version-root/article/worksheet|$version-root/article/handout)"/>
138
135
  <xsl:variable name="version-article-subsections" select="boolean($version-root/article/section/subsection)"/>
139
136
 
140
137
  <!-- A book must have a chapter -->
@@ -151,7 +148,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
151
148
  <xsl:when test="$version-book-sections">2</xsl:when>
152
149
  <xsl:when test="$version-book-chapters">1</xsl:when>
153
150
  <xsl:when test="$version-article-subsections">2</xsl:when>
154
- <xsl:when test="$version-article-sections or $version-article-worksheets or $version-article-handouts">1</xsl:when>
151
+ <xsl:when test="$version-article-sections or $version-article-printouts">1</xsl:when>
155
152
  <xsl:when test="$version-doc-type = 'article'">0</xsl:when>
156
153
  <xsl:when test="$version-doc-type = 'slideshow'">0</xsl:when>
157
154
  <xsl:when test="$version-doc-type = 'letter'">0</xsl:when>
@@ -1399,7 +1396,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
1399
1396
  <!-- WeBWorK problem representations are formed by Python routines -->
1400
1397
  <!-- in the pretext.py module that communicates with a WeBWorK -->
1401
1398
  <!-- server. One file per exercise is written into this directory, -->
1402
- <!-- named by the exercise's @assembly-id. This variable is only -->
1399
+ <!-- named by the exercise's @pi:assembly-id. This variable is only-->
1403
1400
  <!-- relevant for consumption of WW representations into output. -->
1404
1401
  <!-- Keep this variable silent since it may not be necessary. -->
1405
1402
  <xsl:variable name="webwork-representations-dir">
@@ -1515,7 +1512,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
1515
1512
  <xsl:choose>
1516
1513
  <xsl:when test="$version-has-parts">5</xsl:when>
1517
1514
  <xsl:when test="$version-doc-type = 'book'">4</xsl:when>
1518
- <xsl:when test="$version-article-sections or $version-article-worksheets">3</xsl:when>
1515
+ <xsl:when test="$version-article-sections or $version-article-printouts">3</xsl:when>
1519
1516
  <xsl:when test="$version-doc-type = 'article'">0</xsl:when>
1520
1517
  <xsl:when test="$version-doc-type = 'letter'">0</xsl:when>
1521
1518
  <xsl:when test="$version-doc-type = 'slideshow'">0</xsl:when>
@@ -1580,7 +1577,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
1580
1577
  <xsl:choose>
1581
1578
  <xsl:when test="$version-has-parts">3</xsl:when>
1582
1579
  <xsl:when test="$version-doc-type = 'book'">2</xsl:when>
1583
- <xsl:when test="$version-article-sections or $version-article-worksheets">1</xsl:when>
1580
+ <xsl:when test="$version-article-sections or $version-article-printouts">1</xsl:when>
1584
1581
  <xsl:when test="$version-doc-type = 'article'">0</xsl:when>
1585
1582
  <xsl:when test="$version-doc-type = 'slideshow'">0</xsl:when>
1586
1583
  <xsl:when test="$version-doc-type = 'letter'">0</xsl:when>
@@ -1684,14 +1681,10 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
1684
1681
  </xsl:variable>
1685
1682
  <xsl:variable name="numbering-footnotes" select="number($numbering-footnotes-entered)"/>
1686
1683
 
1687
- <!-- The "legacy" consultations of a deprecated "docinfo" analog, -->
1688
- <!-- here and for inline exercises just below, are ripe for -->
1689
- <!-- deletion, certainly during any comprehensive "docinfo" work -->
1690
1684
  <xsl:variable name="numbering-figures-entered">
1691
1685
  <xsl:call-template name="numbering-level">
1692
1686
  <xsl:with-param name="family" select="'figures'"/>
1693
1687
  <xsl:with-param name="entered" select="$publication/numbering/figures/@level"/>
1694
- <xsl:with-param name="legacy" select="$version-docinfo/numbering/figures/@level"/>
1695
1688
  </xsl:call-template>
1696
1689
  </xsl:variable>
1697
1690
  <xsl:variable name="numbering-figures" select="number($numbering-figures-entered)"/>
@@ -1700,7 +1693,6 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
1700
1693
  <xsl:call-template name="numbering-level">
1701
1694
  <xsl:with-param name="family" select="'inline exercises'"/>
1702
1695
  <xsl:with-param name="entered" select="$publication/numbering/exercises/@level"/>
1703
- <xsl:with-param name="legacy" select="$version-docinfo/numbering/exercises/@level"/>
1704
1696
  </xsl:call-template>
1705
1697
  </xsl:variable>
1706
1698
  <xsl:variable name="numbering-exercises" select="number($numbering-exercises-entered)"/>
@@ -1713,14 +1705,14 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
1713
1705
  </xsl:variable>
1714
1706
  <xsl:variable name="numbering-openproblems" select="number($numbering-openproblems-entered)"/>
1715
1707
 
1716
- <!-- A block group may run on its own counter. When its publisher -->
1717
- <!-- switch is absent, the deprecated source is honored, then the -->
1718
- <!-- default. Warnings live with the other deprecations. The two -->
1719
- <!-- deprecated "docinfo" consultations are ripe for deletion, -->
1720
- <!-- certainly during any comprehensive "docinfo" work. -->
1721
- <xsl:variable name="b-number-figure-distinct" select="($publication/numbering/figures/@distinct = 'yes') or (not($publication/numbering/figures/@distinct) and boolean($version-docinfo/numbering/figures))"/>
1722
- <xsl:variable name="b-number-project-distinct" select="($publication/numbering/projects/@distinct = 'yes') or (not($publication/numbering/projects/@distinct) and ($debug.project.number = ''))"/>
1723
- <xsl:variable name="b-number-exercise-distinct" select="($publication/numbering/exercises/@distinct = 'yes') or (not($publication/numbering/exercises/@distinct) and boolean($version-docinfo/numbering/exercises))"/>
1708
+ <!-- A block group may run on its own counter, elected by the -->
1709
+ <!-- publisher switch. The deprecated "docinfo" analogs for -->
1710
+ <!-- figures and inline exercises, and the deprecated -->
1711
+ <!-- debug.project.number parameter, are ignored; warnings live -->
1712
+ <!-- with the other deprecations. -->
1713
+ <xsl:variable name="b-number-figure-distinct" select="$publication/numbering/figures/@distinct = 'yes'"/>
1714
+ <xsl:variable name="b-number-project-distinct" select="$publication/numbering/projects/@distinct = 'yes'"/>
1715
+ <xsl:variable name="b-number-exercise-distinct" select="$publication/numbering/exercises/@distinct = 'yes'"/>
1724
1716
  <xsl:variable name="b-number-openproblem-distinct" select="$publication/numbering/openproblems/@distinct = 'yes'"/>
1725
1717
 
1726
1718
  <xsl:variable name="chapter-start-entered">
@@ -1759,9 +1751,6 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
1759
1751
  <xsl:when test="$publication/numbering/divisions/@part-structure">
1760
1752
  <xsl:message>PTX:FALLBACK: your document is not a book with parts, so the publisher file numbering/divisions/@part-structure entry is being ignored</xsl:message>
1761
1753
  </xsl:when>
1762
- <xsl:when test="$version-docinfo/numbering/division/@part">
1763
- <xsl:message>PTX:DEPRECATE: your document is not a book with parts, and docinfo/numbering/division/@part is deprecated anyway and is being ignored</xsl:message>
1764
- </xsl:when>
1765
1754
  </xsl:choose>
1766
1755
  <!-- flag this situation -->
1767
1756
  <xsl:text>absent</xsl:text>
@@ -1782,22 +1771,9 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
1782
1771
  </xsl:otherwise>
1783
1772
  </xsl:choose>
1784
1773
  </xsl:when>
1785
- <!-- Preserve much of old behavior, warning is elsewhere -->
1786
- <xsl:when test="$version-docinfo/numbering/division/@part">
1787
- <xsl:choose>
1788
- <xsl:when test="$version-docinfo/numbering/division/@part = 'structural'">
1789
- <xsl:text>structural</xsl:text>
1790
- </xsl:when>
1791
- <xsl:when test="$version-docinfo/numbering/division/@part = 'decorative'">
1792
- <xsl:text>decorative</xsl:text>
1793
- </xsl:when>
1794
- <xsl:otherwise>
1795
- <xsl:message>PTX:FALLBACK: the docinfo/numbering/division/@part entry should be "decorative" or "structural", not "<xsl:value-of select="$version-docinfo/numbering/division/@part"/>". The default will be used instead.</xsl:message>
1796
- <xsl:text>decorative</xsl:text>
1797
- </xsl:otherwise>
1798
- </xsl:choose>
1799
- </xsl:when>
1800
- <!-- no specification, use default -->
1774
+ <!-- no specification, use default; the deprecated -->
1775
+ <!-- docinfo/numbering/division/@part is ignored (warnings -->
1776
+ <!-- live with the other deprecations) -->
1801
1777
  <xsl:otherwise>
1802
1778
  <xsl:text>decorative</xsl:text>
1803
1779
  </xsl:otherwise>
@@ -2752,7 +2728,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
2752
2728
  </xsl:when>
2753
2729
  <xsl:when test="$version-has-parts">3</xsl:when>
2754
2730
  <xsl:when test="$version-doc-type = 'book'">2</xsl:when>
2755
- <xsl:when test="$version-article-sections">1</xsl:when>
2731
+ <xsl:when test="$version-article-sections or $version-article-printouts">1</xsl:when>
2756
2732
  <xsl:when test="$version-doc-type = 'article'">0</xsl:when>
2757
2733
  <xsl:when test="$version-doc-type = 'slideshow'">0</xsl:when>
2758
2734
  <xsl:when test="$version-doc-type = 'letter'">0</xsl:when>
@@ -4023,7 +3999,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
4023
3999
  <!-- parameter is deprecated and ineffective, deprecated 2024-02-16. -->
4024
4000
  <xsl:param name="commentary" select="''" />
4025
4001
 
4026
- <!-- Deprecated 2026-06-07, but still respected -->
4002
+ <!-- Deprecated 2026-06-07, and now ignored -->
4027
4003
  <xsl:param name="debug.project.number" select="''" />
4028
4004
 
4029
4005
  <!-- DEPRECATED: 2026-07-25 In favor of -->
@@ -4684,7 +4660,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
4684
4660
  <!-- -->
4685
4661
  <xsl:call-template name="parameter-deprecation-message">
4686
4662
  <xsl:with-param name="date-string" select="'2026-06-07'" />
4687
- <xsl:with-param name="message" select="'the debug.project.number parameter has been replaced by the numbering/projects/@distinct entry in the publisher file. We will attempt to honor your intent. But please switch to using the Publishers File for configuration, as documented in the PreTeXt Guide.'" />
4663
+ <xsl:with-param name="message" select="'the debug.project.number parameter has been replaced by the numbering/projects/@distinct entry in the publisher file. It will be ignored. Please switch to using the Publishers File for configuration, as documented in the PreTeXt Guide.'" />
4688
4664
  <xsl:with-param name="incorrect-use" select="($debug.project.number != '')" />
4689
4665
  </xsl:call-template>
4690
4666
  <!-- -->