@pretextbook/pretext-html 0.5.0 → 0.7.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 +6 -0
- package/assets/preview-html.xsl +14 -0
- package/assets/upstream.json +1 -1
- package/assets/xsl/LICENSE-pretext +1 -1
- package/assets/xsl/README.md +43 -25
- package/assets/xsl/entities.ent +4 -4
- package/assets/xsl/extract-asymptote.xsl +5 -5
- package/assets/xsl/extract-biblio-csl.xsl +1 -1
- package/assets/xsl/extract-datafile.xsl +1 -1
- package/assets/xsl/extract-dynamic.xsl +1 -1
- package/assets/xsl/extract-identity.xsl +5 -5
- package/assets/xsl/extract-interactive.xsl +1 -1
- package/assets/xsl/extract-latex-image.xsl +5 -5
- package/assets/xsl/extract-mermaid.xsl +1 -1
- package/assets/xsl/extract-mom.xsl +5 -5
- package/assets/xsl/extract-pg.xsl +1 -1
- package/assets/xsl/extract-prefigure.xsl +5 -5
- package/assets/xsl/extract-qrcode.xsl +1 -1
- package/assets/xsl/extract-runestone-page-template.xsl +1 -1
- package/assets/xsl/extract-sageplot.xsl +5 -5
- package/assets/xsl/extract-stack.xsl +1 -1
- package/assets/xsl/extract-trace.xsl +1 -1
- package/assets/xsl/extract-youtube.xsl +5 -5
- package/assets/xsl/latex/pretext-latex-AIM.xsl +1 -1
- package/assets/xsl/latex/pretext-latex-chaos.xsl +1 -1
- package/assets/xsl/latex/pretext-latex-dyslexic-font.xsl +1 -1
- package/assets/xsl/latex/pretext-latex-guide.xsl +1 -1
- package/assets/xsl/localizations/README.md +25 -25
- package/assets/xsl/localizations/af-ZA.xml +1 -1
- package/assets/xsl/localizations/bg-BG.xml +1 -1
- package/assets/xsl/localizations/ca-ES.xml +1 -1
- package/assets/xsl/localizations/cs-CZ.xml +1 -1
- package/assets/xsl/localizations/de-DE.xml +1 -1
- package/assets/xsl/localizations/en-US.xml +1 -1
- package/assets/xsl/localizations/es-ES.xml +1 -1
- package/assets/xsl/localizations/fi-FI.xml +1 -1
- package/assets/xsl/localizations/fr-CA.xml +1 -1
- package/assets/xsl/localizations/fr-FR.xml +1 -1
- package/assets/xsl/localizations/hu-HU.xml +1 -1
- package/assets/xsl/localizations/it-IT.xml +1 -1
- package/assets/xsl/localizations/ku-CKB.xml +1 -1
- package/assets/xsl/localizations/localizations.xml +1 -1
- package/assets/xsl/localizations/nl-NL.xml +1 -1
- package/assets/xsl/localizations/pt-BR.xml +1 -1
- package/assets/xsl/localizations/pt-PT.xml +1 -1
- package/assets/xsl/localizations/zh-HANS.xml +1 -1
- package/assets/xsl/pretext-assembly.xsl +64 -1
- package/assets/xsl/pretext-basic-html.xsl +5 -5
- package/assets/xsl/pretext-braille-preprint.xsl +5 -5
- package/assets/xsl/pretext-common.xsl +104 -30
- package/assets/xsl/pretext-dynamic.xsl +1 -1
- package/assets/xsl/pretext-epub.xsl +90 -84
- package/assets/xsl/pretext-fo.xsl +1 -1
- package/assets/xsl/pretext-html.xsl +57 -34
- package/assets/xsl/pretext-json-manifest.xsl +1 -1
- package/assets/xsl/pretext-jupyter.xsl +5 -5
- package/assets/xsl/pretext-latex-classic.xsl +1 -1
- package/assets/xsl/pretext-latex-common.xsl +7 -5
- package/assets/xsl/pretext-latex.xsl +3 -3
- package/assets/xsl/pretext-litprog.xsl +9 -2
- package/assets/xsl/pretext-markdown.xsl +1 -1
- package/assets/xsl/pretext-numbers.xsl +1 -1
- package/assets/xsl/pretext-runestone-fitb.xsl +18 -0
- package/assets/xsl/pretext-runestone-static.xsl +13 -1
- package/assets/xsl/pretext-runestone.xsl +34 -6
- package/assets/xsl/pretext-sage-doctest.xsl +18 -0
- package/assets/xsl/pretext-solution-manual-latex.xsl +4 -4
- package/assets/xsl/pretext-text-utilities.xsl +1 -1
- package/assets/xsl/pretext-text.xsl +5 -5
- package/assets/xsl/pretext-units.xsl +5 -5
- package/assets/xsl/pretext-view-source.xsl +1 -1
- package/assets/xsl/pretext-ww-problem-sets.xsl +15 -12
- package/assets/xsl/publisher-variables.xsl +104 -36
- package/assets/xsl/support/README.md +19 -0
- package/assets/xsl/support/extract-math.xsl +1 -1
- package/assets/xsl/support/package-math.xsl +1 -1
- package/assets/xsl/support/play-button/README.md +3 -1
- package/assets/xsl/support/webpack_static_imports.xml +19 -0
- package/assets/xsl/tests/README.md +20 -1
- package/assets/xsl/tests/null.xml +19 -0
- package/assets/xsl/tests/pretext-text-utilities-test.xsl +1 -1
- package/assets/xsl/utilities/README.md +27 -6
- package/assets/xsl/utilities/author-report.xsl +1 -1
- package/assets/xsl/utilities/fix-deprecations.xsl +5 -5
- package/assets/xsl/utilities/pretext-enhanced-source.xsl +1 -1
- package/assets/xsl/utilities/report-publisher-variables.xsl +5 -5
- package/assets/xsl/xml-to-json.xsl +4 -4
- package/assets/xsl-bundle.json +1 -1
- package/dist/banner.d.ts +51 -0
- package/dist/{cli-DZsyZERX.js → cli-D0m0Ha1j.js} +358 -196
- package/dist/cli.js +2 -2
- package/dist/index.browser.d.ts +3 -0
- package/dist/index.browser.js +477 -322
- package/dist/index.d.ts +3 -0
- package/dist/index.js +25 -21
- package/dist/knowls.d.ts +43 -0
- package/dist/renderer.d.ts +26 -0
- package/package.json +1 -1
- package/assets/xsl/pretext-smc.xsl +0 -492
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
<!--********************************************************************
|
|
2
|
+
Copyright (C) 2025-2026 Robert A. Beezer
|
|
3
|
+
|
|
4
|
+
This file is part of PreTeXt.
|
|
5
|
+
|
|
6
|
+
PreTeXt is free software: you can redistribute it and/or modify
|
|
7
|
+
it under the terms of the GNU General Public License as published by
|
|
8
|
+
the Free Software Foundation, either version 2 or version 3 of the
|
|
9
|
+
License (at your option).
|
|
10
|
+
|
|
11
|
+
PreTeXt is distributed in the hope that it will be useful,
|
|
12
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
GNU General Public License for more details.
|
|
15
|
+
|
|
16
|
+
You should have received a copy of the GNU General Public License
|
|
17
|
+
along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
*****************************************************************-->
|
|
19
|
+
|
|
1
20
|
# XSL Automated Tests
|
|
2
21
|
|
|
3
22
|
This folder contains testing utilities for XSL templates. The tests focus on function-like templates for tasks like string manipulation that are used as helpers throughout the XSL stylesheets. Most of these functions are otherwise only observable indirectly through their effects on the output of the main XSL stylesheets.
|
|
@@ -21,4 +40,4 @@ Refer to the existing tests in `pretext-text-utilities-test.xsl` for examples of
|
|
|
21
40
|
## Files
|
|
22
41
|
|
|
23
42
|
- `pretext-text-utilities-test.xsl`: Contains tests for the text utilities templates.
|
|
24
|
-
- `null.xml`: A minimal XML file used as input for the tests.
|
|
43
|
+
- `null.xml`: A minimal XML file used as input for the tests.
|
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
2
|
+
|
|
3
|
+
<!--********************************************************************
|
|
4
|
+
Copyright (C) 2025-2026 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
|
+
*****************************************************************-->
|
|
2
21
|
<!-- intentionally empty valid XML file for use with pretext-text-utilities-text.xsl -->
|
|
3
22
|
<nothing>
|
|
4
23
|
</nothing>
|
|
@@ -1,29 +1,50 @@
|
|
|
1
|
+
<!--********************************************************************
|
|
2
|
+
Copyright (C) 2017-2026 Robert A. Beezer
|
|
3
|
+
|
|
4
|
+
This file is part of PreTeXt.
|
|
5
|
+
|
|
6
|
+
PreTeXt is free software: you can redistribute it and/or modify
|
|
7
|
+
it under the terms of the GNU General Public License as published by
|
|
8
|
+
the Free Software Foundation, either version 2 or version 3 of the
|
|
9
|
+
License (at your option).
|
|
10
|
+
|
|
11
|
+
PreTeXt is distributed in the hope that it will be useful,
|
|
12
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
GNU General Public License for more details.
|
|
15
|
+
|
|
16
|
+
You should have received a copy of the GNU General Public License
|
|
17
|
+
along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
*****************************************************************-->
|
|
19
|
+
|
|
1
20
|
# Utilities
|
|
2
21
|
|
|
3
22
|
## Source-to-Source conversions
|
|
4
23
|
|
|
5
|
-
For utility programs here which rewrite your source, be **sure** to use version control (collect and review changes on a branch, stash and drop undesirable outcomes), or have backups handy.
|
|
24
|
+
For utility programs here which rewrite your source, be **sure** to use version control (collect and review changes on a branch, stash and drop undesirable outcomes), or have backups handy. The effects are not reversible. Stylesheets will output to standard output, so you can redirect their output, or you can use something like the `-o` flag on the `xsltproc` command-line invocation. Experiment first.
|
|
6
25
|
|
|
7
26
|
### `fix-deprecations.xsl`
|
|
8
|
-
This will convert any obsolete element names or constructions to their replacements. As deprecations are added, you may run it anew, and only the new changes will be applied. Despite the name, it does make some minor changes. Empty tags will get a single space prior to the closing backslash.
|
|
9
27
|
|
|
10
|
-
|
|
28
|
+
This will convert any obsolete element names or constructions to their replacements. As deprecations are added, you may run it anew, and only the new changes will be applied. Despite the name, it does make some minor changes. Empty tags will get a single space prior to the closing backslash.
|
|
29
|
+
|
|
30
|
+
Be sure to read all the details in the Author's Guide before using this on your source. Here is an absolute minimal example.
|
|
31
|
+
|
|
11
32
|
```
|
|
12
33
|
$ xsltproc /path/to/xsl/utilities/fix-deprecations.xsl -stringparam fix all /path/to/examples/sample-errors-and-warnings.xml > new-sample.xml
|
|
13
34
|
|
|
14
35
|
$ diff /path/to/examples/sample-errors-and-warnings.xml new-sample.xml
|
|
15
36
|
```
|
|
16
|
-
(Updated: 2017-07-04)
|
|
17
37
|
|
|
38
|
+
(Updated: 2017-07-04)
|
|
18
39
|
|
|
19
40
|
## Author Report
|
|
20
41
|
|
|
21
|
-
`author-report.xsl` is a very simple stylesheet which will produce a text version of items in your source that could benefit from your attention.
|
|
42
|
+
`author-report.xsl` is a very simple stylesheet which will produce a text version of items in your source that could benefit from your attention. This is different than validating your PreTeXt source against the schema, but is part of using automated tools to ensure healthy source material.
|
|
22
43
|
|
|
23
44
|
(Updated: 2018-12-09)
|
|
24
45
|
|
|
25
46
|
## Intermediate Enhanced Source
|
|
26
47
|
|
|
27
|
-
`pretext-enhanced-source.xsl` is mainly meant for development use.
|
|
48
|
+
`pretext-enhanced-source.xsl` is mainly meant for development use. It outputs an XML file, which is not necessarily valid PreTeXt, at a key stage of the processing. It gives you a look under the hood (or bonnet). So generally not useful (or necessary) for authors.
|
|
28
49
|
|
|
29
50
|
(Updated: 2020-02-25)
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
<?xml version='1.0'?>
|
|
2
2
|
|
|
3
3
|
<!--********************************************************************
|
|
4
|
-
Copyright 2017
|
|
4
|
+
Copyright (C) 2017-2026 Robert A. Beezer
|
|
5
5
|
|
|
6
|
-
This file is part of
|
|
6
|
+
This file is part of PreTeXt.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
PreTeXt is free software: you can redistribute it and/or modify
|
|
9
9
|
it under the terms of the GNU General Public License as published by
|
|
10
10
|
the Free Software Foundation, either version 2 or version 3 of the
|
|
11
11
|
License (at your option).
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
PreTeXt is distributed in the hope that it will be useful,
|
|
14
14
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
15
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
16
|
GNU General Public License for more details.
|
|
17
17
|
|
|
18
18
|
You should have received a copy of the GNU General Public License
|
|
19
|
-
along with
|
|
19
|
+
along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
20
20
|
*********************************************************************-->
|
|
21
21
|
|
|
22
22
|
<!-- Identify as a stylesheet -->
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
<?xml version='1.0'?> <!-- As XML file -->
|
|
2
2
|
|
|
3
3
|
<!--********************************************************************
|
|
4
|
-
Copyright 2013
|
|
4
|
+
Copyright (C) 2013-2026 Robert A. Beezer
|
|
5
5
|
|
|
6
|
-
This file is part of
|
|
6
|
+
This file is part of PreTeXt.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
PreTeXt is free software: you can redistribute it and/or modify
|
|
9
9
|
it under the terms of the GNU General Public License as published by
|
|
10
10
|
the Free Software Foundation, either version 2 or version 3 of the
|
|
11
11
|
License (at your option).
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
PreTeXt is distributed in the hope that it will be useful,
|
|
14
14
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
15
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
16
|
GNU General Public License for more details.
|
|
17
17
|
|
|
18
18
|
You should have received a copy of the GNU General Public License
|
|
19
|
-
along with
|
|
19
|
+
along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
20
20
|
*********************************************************************-->
|
|
21
21
|
|
|
22
22
|
<!-- http://pimpmyxslt.com/articles/entity-tricks-part2/ -->
|
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
<!--********************************************************************
|
|
4
4
|
Copyright 2023 Jason Siefken
|
|
5
5
|
|
|
6
|
-
This file is part of
|
|
6
|
+
This file is part of PreTeXt.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
PreTeXt is free software: you can redistribute it and/or modify
|
|
9
9
|
it under the terms of the GNU General Public License as published by
|
|
10
10
|
the Free Software Foundation, either version 2 or version 3 of the
|
|
11
11
|
License (at your option).
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
PreTeXt is distributed in the hope that it will be useful,
|
|
14
14
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
15
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
16
|
GNU General Public License for more details.
|
|
17
17
|
|
|
18
18
|
You should have received a copy of the GNU General Public License
|
|
19
|
-
along with
|
|
19
|
+
along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
20
20
|
*********************************************************************-->
|
|
21
21
|
|
|
22
22
|
<!--
|