@pretextbook/pretext-html 0.16.1 → 0.18.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 +163 -18
- package/assets/preview-html.xsl +81 -14
- package/assets/preview-revealjs.xsl +7 -2
- package/dist/assets.d.ts +9 -5
- package/dist/banner.d.ts +2 -2
- package/dist/cli-CKAOX3L6.js +1494 -0
- package/dist/cli.d.ts +12 -1
- package/dist/cli.js +8 -3
- package/dist/index.browser.d.ts +10 -5
- package/dist/index.browser.js +1182 -856
- package/dist/index.d.ts +10 -4
- package/dist/index.js +49 -44
- package/dist/publication.d.ts +75 -21
- package/dist/renderer.d.ts +151 -23
- package/dist/skeleton.d.ts +68 -7
- package/dist/source-cache.d.ts +36 -0
- package/dist/sourcemap.d.ts +11 -1
- package/dist/subtree.d.ts +79 -0
- package/dist/target.d.ts +1 -1
- package/dist/xinclude.d.ts +40 -3
- package/package.json +1 -1
- package/dist/cli-DzlCZymu.js +0 -1145
package/dist/cli.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RenderOptions } from './renderer.js';
|
|
1
|
+
import { RenderOptions, RenderResult } from './renderer.js';
|
|
2
2
|
interface CliArgs {
|
|
3
3
|
options: RenderOptions;
|
|
4
4
|
output?: string;
|
|
@@ -13,5 +13,16 @@ interface CliArgs {
|
|
|
13
13
|
printPreview?: string | true;
|
|
14
14
|
}
|
|
15
15
|
export declare function parseArgs(argv: string[]): CliArgs;
|
|
16
|
+
/**
|
|
17
|
+
* Point the page's `external/` and `generated/` URLs at the project's files,
|
|
18
|
+
* relative to `pageDir`, so a page written to disk opens with its images.
|
|
19
|
+
*
|
|
20
|
+
* A real build copies both directories next to its pages; the CLI writes one
|
|
21
|
+
* page and copies nothing, so it links the files where they are. A file that
|
|
22
|
+
* does not exist gets the same placeholder the VS Code preview shows, which
|
|
23
|
+
* says what to generate. A file on another drive than the page (Windows) has
|
|
24
|
+
* no relative path, and gets an absolute file URL instead.
|
|
25
|
+
*/
|
|
26
|
+
export declare function linkAssetsFrom(html: string, assetDirs: RenderResult["assetDirs"], pageDir: string): string;
|
|
16
27
|
export declare function main(argv: string[]): Promise<void>;
|
|
17
28
|
export {};
|
package/dist/cli.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
import "node:fs";
|
|
1
2
|
import "node:fs/promises";
|
|
3
|
+
import "node:path";
|
|
2
4
|
import "node:process";
|
|
5
|
+
import "node:url";
|
|
6
|
+
import "./assets.js";
|
|
3
7
|
import "./printout.js";
|
|
4
|
-
import {
|
|
8
|
+
import { u as n, q as A, v as f } from "./cli-CKAOX3L6.js";
|
|
5
9
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
10
|
+
n as linkAssetsFrom,
|
|
11
|
+
A as main,
|
|
12
|
+
f as parseArgs
|
|
8
13
|
};
|
package/dist/index.browser.d.ts
CHANGED
|
@@ -12,8 +12,9 @@
|
|
|
12
12
|
* false; several engines still do not ship it.
|
|
13
13
|
* - **Pass `sourceContent`.** There is no filesystem, so `sourcePath` serves
|
|
14
14
|
* only as a virtual base for URL and xi:include resolution.
|
|
15
|
-
* - **`xi:include`s are not resolved from disk.**
|
|
16
|
-
*
|
|
15
|
+
* - **`xi:include`s are not resolved from disk.** Supply the project's files
|
|
16
|
+
* through `readSource` or `files` and they are resolved from there — or
|
|
17
|
+
* pre-merge them and pass the merged document as `sourceContent`.
|
|
17
18
|
* - **Use `contextSourceContent`, not `contextSourcePath`**, to place a
|
|
18
19
|
* fragment in its document for correct numbering and resolved `<xref>`s
|
|
19
20
|
* (see `RenderOptions.contextSourceContent`) — `contextSourcePath` alone
|
|
@@ -21,11 +22,15 @@
|
|
|
21
22
|
* - **Assets come from jsDelivr by default**, version-pinned to this package.
|
|
22
23
|
* Call `setAssetsBase()` before the first render to self-host.
|
|
23
24
|
*/
|
|
24
|
-
export { renderHtml, defaultXslDir, isJspiAvailable, xpathStringLiteral, } from './renderer.js';
|
|
25
|
-
export type { RenderOptions, RenderResult } from './renderer.js';
|
|
25
|
+
export { renderHtml, measureDocument, defaultSourceCache, defaultXslDir, isJspiAvailable, xpathStringLiteral, } from './renderer.js';
|
|
26
|
+
export type { DocumentSize, RenderOptions, RenderResult, SourceOptions, } from './renderer.js';
|
|
27
|
+
export type { SubtreeOptions } from './subtree.js';
|
|
28
|
+
export { SourceCache } from './source-cache.js';
|
|
29
|
+
export type { SourceCacheOptions } from './source-cache.js';
|
|
30
|
+
export type { SourceReader } from './xinclude.js';
|
|
26
31
|
export { findSourceMapEntry } from './sourcemap.js';
|
|
27
32
|
export type { PtxSourceMap, SourceMapEntry } from './sourcemap.js';
|
|
28
|
-
export { forcePortablePublication } from './publication.js';
|
|
33
|
+
export { forcePreviewPublication, forcePortablePublication, } from './publication.js';
|
|
29
34
|
export type { PublicationOverrides } from './publication.js';
|
|
30
35
|
export { detectRenderTarget } from './target.js';
|
|
31
36
|
export type { RenderTarget } from './target.js';
|