@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
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as r, f as i, a as t, i as a, r as l, m as o, s as m, b as n, x as d } from "./cli-
|
|
1
|
+
import { d as r, f as i, a as t, i as a, r as l, m as o, s as m, b as n, x as d } from "./cli-Cp6C0sif.js";
|
|
2
2
|
import { describeAsset as c, missingAssetPlaceholder as f, missingAssetSvg as g, rewriteAssetUrls as A } from "./assets.js";
|
|
3
3
|
import { PREVIEW_THEME_MESSAGE as h, injectThemeBridge as S, isPreviewTheme as b, previewThemeMessage as u, themeBridgeScript as x } from "./theme.js";
|
|
4
4
|
export {
|
package/dist/publication.d.ts
CHANGED
|
@@ -8,12 +8,20 @@
|
|
|
8
8
|
* variables can only come from a publication file — there is no stringparam
|
|
9
9
|
* for `portable` — so we rewrite the user's publication file (or synthesize a
|
|
10
10
|
* minimal one) and serve it through the fetch shim as a virtual file.
|
|
11
|
+
*
|
|
12
|
+
* That rewrite is also how an embedder's default HTML theme gets in
|
|
13
|
+
* (`<html><css theme="..."/></html>`): same reason, no stringparam for it
|
|
14
|
+
* either, short of `debug.html.theme-name`.
|
|
11
15
|
*/
|
|
12
16
|
/**
|
|
13
17
|
* Return publication-file XML with `<html><platform portable="yes"/></html>`
|
|
14
18
|
* forced, preserving everything else from `publicationXml` when given.
|
|
19
|
+
*
|
|
20
|
+
* `cssTheme`, when given, supplies `<html><css theme="..."/></html>` for
|
|
21
|
+
* projects that do not choose an HTML theme themselves; see
|
|
22
|
+
* `RenderOptions.cssTheme`. A blank value is ignored.
|
|
15
23
|
*/
|
|
16
|
-
export declare function forcePortablePublication(publicationXml?: string): string;
|
|
24
|
+
export declare function forcePortablePublication(publicationXml?: string, cssTheme?: string): string;
|
|
17
25
|
/**
|
|
18
26
|
* Where a project's images live, as declared by
|
|
19
27
|
* `<source><directories external generated/></source>`.
|
package/dist/renderer.d.ts
CHANGED
|
@@ -35,6 +35,26 @@ export interface RenderOptions {
|
|
|
35
35
|
* `<html><platform portable="yes"/></html>`, which the preview forces.
|
|
36
36
|
*/
|
|
37
37
|
publicationPath?: string;
|
|
38
|
+
/**
|
|
39
|
+
* PreTeXt HTML theme to fall back on, inserted into the publication file
|
|
40
|
+
* used for the build as `<html><css theme="..."/></html>`.
|
|
41
|
+
*
|
|
42
|
+
* A default, not an override: it applies only when the project's own
|
|
43
|
+
* publication file names no theme (neither `@theme` nor the deprecated
|
|
44
|
+
* `@style`/`@shell`), so a project that has chosen one keeps it. Blank is
|
|
45
|
+
* ignored, and with no publication file at all it themes the synthesized
|
|
46
|
+
* minimal one.
|
|
47
|
+
*
|
|
48
|
+
* Portable builds load `theme-<name>.min.css` from the CDN, so an
|
|
49
|
+
* unrecognised name renders an unstyled page. The themes the vendored
|
|
50
|
+
* stylesheets know are default-modern (PreTeXt's own default), denver,
|
|
51
|
+
* tacoma, salem, greeley and boulder; `custom` additionally needs a locally
|
|
52
|
+
* compiled stylesheet, which this renderer cannot produce.
|
|
53
|
+
*
|
|
54
|
+
* Distinct from {@link RenderOptions.theme}, which is the light/dark mode
|
|
55
|
+
* *within* whichever css theme is in force.
|
|
56
|
+
*/
|
|
57
|
+
cssTheme?: string;
|
|
38
58
|
/** Additional XSLT string parameters, passed as strings (quoted for you). */
|
|
39
59
|
stringParams?: Record<string, string>;
|
|
40
60
|
/** Directory of PreTeXt XSL stylesheets. Defaults to the vendored copy. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pretextbook/pretext-html",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Convert PreTeXt documents to HTML in pure JavaScript using the official PreTeXt XSLT stylesheets via libxslt-wasm. No Python or PreTeXt installation required.",
|
|
5
5
|
"author": "Oscar Levin",
|
|
6
6
|
"license": "MIT",
|