@pretextbook/web-editor 0.5.0 → 0.5.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.es.js +4 -4
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/sectionUtils.d.ts +12 -4
- package/package.json +1 -1
package/dist/sectionUtils.d.ts
CHANGED
|
@@ -313,15 +313,23 @@ export declare function assembleProjectSource(divisions: Division[], rootXmlId:
|
|
|
313
313
|
* `<section xml:id="...">...</section>`) into a standalone PreTeXt fragment
|
|
314
314
|
* document suitable for a build-server preview of just that division.
|
|
315
315
|
*
|
|
316
|
-
*
|
|
317
|
-
*
|
|
318
|
-
*
|
|
316
|
+
* This function itself never expands `<plus:* ref="..."/>` placeholders —
|
|
317
|
+
* the real build server has no notion of that placeholder syntax, so callers
|
|
318
|
+
* must resolve them first (e.g. via {@link assembleProjectSource}) before
|
|
319
|
+
* passing `divisionXml` in. Passing unresolved refs produces invalid PreTeXt
|
|
320
|
+
* and a build failure.
|
|
319
321
|
*
|
|
320
322
|
* `divisionType` determines the minimal wrapper needed around `divisionXml`:
|
|
321
323
|
* root types (`book`/`article`/`slideshow`) need none, `chapter`/`part` are
|
|
322
324
|
* wrapped in a bare `<book>`, and everything else in a bare `<article>`.
|
|
325
|
+
* The PreTeXt schema requires `<book>`/`<article>` to have a `<title>` as
|
|
326
|
+
* their first child, so a wrapper built here uses `wrapperTitle` for that —
|
|
327
|
+
* without it the build server's schema validation rejects the document,
|
|
328
|
+
* produces no output, and 500s.
|
|
323
329
|
* `docinfo` (the full `<docinfo>...</docinfo>` element, or `""`) is inserted
|
|
324
330
|
* as a sibling of the root element inside `<pretext>`, matching real PreTeXt
|
|
325
331
|
* 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.
|
|
326
334
|
*/
|
|
327
|
-
export declare function wrapDivisionForPreview(divisionType: DivisionType, divisionXml: string, docinfo: string): string;
|
|
335
|
+
export declare function wrapDivisionForPreview(divisionType: DivisionType, divisionXml: string, docinfo: string, wrapperTitle: string): string;
|