@pretextbook/web-editor 0.5.2 → 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.
@@ -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
- * Assemble the full PreTeXt source for a project by resolving the root
301
- * division and recursively expanding every `<plus:* ref="..."/>` placeholder
302
- * it (transitively) contains, converting any LaTeX/Markdown divisions to
303
- * PreTeXt along the way.
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 what a host application sends to the build server (e.g.
306
- * `https://build.pretext.plus`) to produce the final rendered document the
307
- * `divisions` pool itself is never a valid build input, since it's a flat
308
- * list of fragments rather than a single document tree.
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