@pretextbook/pretext-html 0.9.0 → 0.10.1

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/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { O as r, P as i, b as a, d as t, a as n, c as o, f as l, e as d, i as p, g as E, o as c, p as m, r as v, h as S, j as g, m as A, s as f, k as B, x as P } from "./cli-BUrNZxov.js";
1
+ import { O as r, P as i, b as a, d as t, a as n, c as o, f as l, e as d, i as p, g as E, o as c, p as m, r as v, h as S, j as g, m as A, s as f, k as B, x as P } from "./cli-C3B-AvUy.js";
2
2
  import { injectRevealBridge as R, isRevealView as h, revealBridgeScript as _ } from "./reveal.js";
3
3
  import { describeAsset as u, missingAssetPlaceholder as x, missingAssetSvg as M, rewriteAssetUrls as T } from "./assets.js";
4
4
  import { PREVIEW_THEME_MESSAGE as G, injectThemeBridge as k, isPreviewTheme as H, previewThemeMessage as L, themeBridgeScript as O } from "./theme.js";
@@ -157,8 +157,26 @@ export interface RenderOptions {
157
157
  *
158
158
  * Supersedes `docinfoSourcePath`, since the skeleton carries the document's
159
159
  * real `<docinfo>`. Only used in fragment mode; ignored for whole documents.
160
+ * Optional when `contextSourceContent` is given — see there — but still
161
+ * used as the virtual base for xi:include resolution and source-map paths
162
+ * even then, so pass it whenever a real path is available.
160
163
  */
161
164
  contextSourcePath?: string;
165
+ /**
166
+ * The complete document's source text, used instead of reading
167
+ * `contextSourcePath` from disk. Lets a browser host that already holds the
168
+ * whole project in memory place a fragment in its document — with
169
+ * correct numbering and resolved `<xref>`s — without a filesystem or
170
+ * network round trip, and lets the skeleton see *unsaved* sibling
171
+ * divisions that a read from disk never would.
172
+ *
173
+ * `contextSourcePath` becomes optional when this is given, defaulting to
174
+ * `sourcePath` as the virtual base for resolving the document's own
175
+ * xi:includes; pass `contextSourcePath` too when a real one is available,
176
+ * for more useful source-map/error paths. Exactly parallel to
177
+ * `sourceContent` vs. `sourcePath`.
178
+ */
179
+ contextSourceContent?: string;
162
180
  /**
163
181
  * Tooltip for links whose target is not on the previewed page — the table of
164
182
  * contents, and cross-references reaching outside the fragment. Those cannot
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pretextbook/pretext-html",
3
- "version": "0.9.0",
3
+ "version": "0.10.1",
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",