@pretextbook/web-editor 0.5.1 → 0.5.3
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.d.ts +1 -1
- package/dist/index.es.js +67 -52
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/sectionUtils.d.ts +24 -10
- package/dist/web-editor.css +1 -1
- package/package.json +1 -1
package/dist/sectionUtils.d.ts
CHANGED
|
@@ -297,17 +297,33 @@ export declare function buildDivisionTree(divisions: Division[], startXmlId: str
|
|
|
297
297
|
*/
|
|
298
298
|
export declare function getOrphanRoots(divisions: Division[], rootXmlId: string): Division[];
|
|
299
299
|
/**
|
|
300
|
-
*
|
|
301
|
-
*
|
|
302
|
-
*
|
|
303
|
-
*
|
|
300
|
+
* Resolve the root division and recursively expand every
|
|
301
|
+
* `<plus:* ref="..."/>` placeholder it (transitively) contains, converting
|
|
302
|
+
* any LaTeX/Markdown divisions to PreTeXt along the way. Returns the bare
|
|
303
|
+
* root element (e.g. `<book>...</book>`) — *not* wrapped in `<pretext>` and
|
|
304
|
+
* without `<docinfo>`.
|
|
304
305
|
*
|
|
305
|
-
* This is
|
|
306
|
-
*
|
|
307
|
-
*
|
|
308
|
-
*
|
|
306
|
+
* This is the body half of a full document. Most callers that want an
|
|
307
|
+
* actual buildable/persistable document should use
|
|
308
|
+
* {@link assembleFullProjectSource} instead; this lower-level function
|
|
309
|
+
* remains for callers (like the division-scoped preview path) that need to
|
|
310
|
+
* compose the resolved body further before wrapping it themselves.
|
|
309
311
|
*/
|
|
310
312
|
export declare function assembleProjectSource(divisions: Division[], rootXmlId: string): string;
|
|
313
|
+
/**
|
|
314
|
+
* Assemble the complete PreTeXt document for a project: the root division,
|
|
315
|
+
* fully resolved (every `<plus:* ref="..."/>` placeholder expanded and any
|
|
316
|
+
* LaTeX/Markdown divisions converted to PreTeXt), wrapped in the outer
|
|
317
|
+
* `<pretext>` element with `<docinfo>` inserted as its sibling.
|
|
318
|
+
*
|
|
319
|
+
* This is the same shape produced for a root-division preview build, and is
|
|
320
|
+
* what a host application should persist as "the full source" and send to a
|
|
321
|
+
* build server (e.g. `https://build.pretext.plus`) to produce the final
|
|
322
|
+
* rendered document — the `divisions` pool itself is never a valid build
|
|
323
|
+
* input, since it's a flat list of fragments rather than a single document
|
|
324
|
+
* tree.
|
|
325
|
+
*/
|
|
326
|
+
export declare function assembleFullProjectSource(divisions: Division[], rootXmlId: string, docinfo: string): string;
|
|
311
327
|
/**
|
|
312
328
|
* Wrap a single division's own tagged XML (e.g.
|
|
313
329
|
* `<section xml:id="...">...</section>`) into a standalone PreTeXt fragment
|
|
@@ -329,7 +345,5 @@ export declare function assembleProjectSource(divisions: Division[], rootXmlId:
|
|
|
329
345
|
* `docinfo` (the full `<docinfo>...</docinfo>` element, or `""`) is inserted
|
|
330
346
|
* as a sibling of the root element inside `<pretext>`, matching real PreTeXt
|
|
331
347
|
* document shape.
|
|
332
|
-
*
|
|
333
|
-
* We need to add `label="preview"` (or really any label) since if this isn't present the build server won't know what file to return.
|
|
334
348
|
*/
|
|
335
349
|
export declare function wrapDivisionForPreview(divisionType: DivisionType, divisionXml: string, docinfo: string, wrapperTitle: string): string;
|