Chapter 12.3 · Part III · In practice
Sandbox: books, Word files and saving
Books and chapters, editing comic pages, importing and exporting Word documents, and how the Sandbox saves, exports and imports your work
In short
This page covers how you organise and keep your work in the Sandbox. A project is a book made of chapters. Comic pages have their own tools for panels and speech. You can bring in a Word file, choose how its styles become Postext styles, and send the book back to Word. Your work is saved in your own browser as you go, and you can download it as one file and open it again later.
#Books and chapters
Everything you open in the Sandbox is a book, the way an InDesign book file groups one document per chapter: the configuration, the custom fonts and the resource set are shared by the whole book, and each chapter is its own markdown document. Long works — a five-hundred-page textbook — are edited one chapter at a time, while numbering, cross-references and export still see one document.
- Structure lives in the Chapters panel and in the Text panel's chapter switcher: add, rename (double-click a row), reorder, split a chapter into one per level-1 heading, merge a chapter into the previous one, delete. Every chapter keeps its own undo history and caret.
- One chapter at a time. By default the previews lay out the active chapter, continued after the chapters before it: its first page number follows the last page of the previous chapter, level-1 headings keep counting (chapter 4 is numbered 4, its figures 4.1, 4.2, …),
{chapterNumber}and{chapterTitle}running heads follow, recto/verso parity is kept (a chapter opener pads a blank page exactly as it would mid-book), and a:refto a figure first mentioned in chapter 1 keeps that number. The page counts of the preceding chapters come from the layout that last showed each of them; chapters never visited (or edited since) are laid out in the background, one after the other, and the chapter list reads pages pending until they land. Page ranges are exact for chapters that open on a fresh page (the default); a chapter whose text would have run on from the previous page is placed at the top of its own page instead. - Whole book. The canvas, the HTML preview and the PDF tab can show the whole book as one continuous document: pick Whole book in the selector at the left of the tab bar (books with more than one chapter). The canvas then lays out every chapter in order, each after the pages the ones before it came to, and shows the documents stitched together — an edit re-lays out its chapter alone, and the chapters after it only when their first page moved; the chapter list, the
chapter=andpage=parts of the permalink and the editor sync follow the page's chapter. The choice is kept with the book (a short novel reads as one document, a textbook one chapter at a time), and a preset can open that way through the manifest'sview.canvasScope. The HTML preview shares the canvas choice and lays the whole book out as one document from its first page, the contents rows and the fragment following each page's chapter; the PDF tab keeps its own selector. - Long books. A book of 120 chapters works like a short one. The chapter menu in the Text panel's header scrolls within the window and opens on the active chapter; the arrow keys move from it. A book in parts (
:::partfences in its chapters) lists its chapters under their parts, in the menu and in the Chapters panel, and a click on a part in the menu opens its first chapter. Above 30 chapters the menu has a search field at the top that matches chapter numbers (27) and words of the titles and part names (埋香,卷三); Enter opens the first match. While an input method is composing (Zhuyin, Cangjie, pinyin, kana), Enter and the arrow keys belong to it: Enter confirms the conversion and opens nothing. A sample book's chapter files load eight at a time, and while the chapters are paginated in the background the Chapters panel shows the progress (Paginating 34/120). The canvas and the HTML preview show a book of more than 200 chapters one chapter at a time, whatever the book or its manifest ask: laying out every chapter at once holds the whole book in memory. A book below that can open whole: 紅樓夢 (129 chapters, some 2,000 pages) takes about 25 seconds and 100 MB on the canvas. The PDF tab can still export any book whole. - Front matter. The first chapter's front matter is the book's front matter (title, author, …). A front-matter block at the top of any other chapter is ignored, and the Checks panel says so.
buildBundlefollows the same rule, so a book renders the same in the Sandbox and in your own program. - Page counts. Each chapter is laid out as a document of its own, so
{totalPages}counts the chapter's pages.{bookTotalPages}counts the whole book: once every chapter's pages are known, the previews lay each chapter out with that total (only when a header, footer or design prints it). Until then a chapter prints the pages up to its own end. The PDF tab's Whole book counts the pages it lays out, so the file always prints the book's real total. - Chapter openers. No page break is forced between chapters: a chapter whose first block is a level-1 heading opens on a fresh page through the heading's own break before setting, exactly like a chapter that starts mid-document.
- Sync. Clicking a paragraph of any chapter in the Canvas or HTML preview switches the editor to that chapter and places the caret; the editor caret is highlighted in the previews wherever the chapter sits in the book. Warnings carry their chapter.
- Existing documents open as a book with one chapter; nothing changes until a second chapter is added.
#Editing comics
A chapter with comic pages (:::page) or strips (:::strip) can be edited on the pages themselves, in the Canvas tab, the HTML tab and the Folio's select mode. The tools work the same on a strip set in a column, floated to the head of a page or across it, narrower than its measure or under a caption, and write into the strip's own fence. Every change is written into the chapter's Markdown, as a typed edit would be, so the editor's undo takes it back. The markup and the lettering rules are explained in Comics.
- Splitters. Over the gutter between two panels the pointer turns into a resize cursor. Drag it to move the split line; on release the new percentage is written into the page's
splitattribute (added to the fence when the page has none) and the page is laid out again. Shift snaps the line to steps of 5 %, Alt moves only the end nearer the pointer, slanting the line, and no panel gets narrower than 5 %. While you drag, a panel whose picture would no longer keep its safe area in view is marked, with a hint. Each splitter is also a focusable separator: the arrow keys move it by 1 % (5 % with Shift), Enter writes the position and Escape puts it back. - Split and merge. Over a panel a small toolbar offers Split with a horizontal line, Split with a vertical line (an empty
::panelline is added for the new cell, right after this panel) and Merge with the next panel: the line between them goes, and the merged panel keeps the first panel's picture and takes the script lines of both. The panels can also be reached with Tab: a focused panel is outlined, H splits it with a horizontal line, V with a vertical one, and M merges it with the next panel; focus stays on the panel after the page is laid out again. Enter opens the toolbar, and Escape goes back from it to the panel. - Balloons. Drag a balloon to pin it: on release its script line gets
at="x% y%", the point in percentages of the panel's picture (of the cell for a panel without one), so the pin stays on the same spot of the drawing through crops, splitter drags and translations. A joined group moves as one, pinned by its first balloon. The arrow keys nudge a focused balloon by 1 % (5 % with Shift), and a double click on a pinned balloon removes itsat, handing it back to the automatic placement. A single click puts the editor's caret on the balloon's line. - Overflow hint. While a balloon moves, by pointer or by arrow keys, the preview checks where it would land. If it would cover a face or an avoid zone, or run out of its panel further than it does now, the moving outline turns orange, the panel's faces and avoid zones are drawn dashed, and the tooltip says which: Here it would cover a face, Here it would cover a part of the picture kept clear, Here it would run out of the panel. A line with
breakis not flagged for leaving its panel. The hint does not foresee how the other balloons of the panel will move to make room. - Tails. Over the tip of a tail the pointer turns into a crosshair. Drag the tip to where the tail should aim: on release the line gets
to="x% y%", the point in percentages of the panel's picture, and the tail turns toward it, stopping short of it as it does before a mouth. Escape cancels the drag, and a double click on the tip removesto, so the tail points at its speaker again. From the keyboard, T on a focused balloon moves to its tail: the arrow keys move the point it aims at by 1 % (5 % with Shift), Enter writes it, Escape puts it back, Delete removesto, and T goes back to the balloon. - Speakers and avoid zones. On a picture in the Resources panel, the Safe area & lettering field opens a dialog with three modes. Safe area marks the part of the picture that must stay in view. Speakers places one point per character: a click on the picture adds a speaker there and focuses its id, which must be the speaker key the script uses (
maya: …); its mouth, head (where thought bubbles point) and face (never covered by a balloon) are dragged into place. Avoid zones are rectangles no balloon covers, drawn by dragging over the picture. The same mode marks the faces of people who do not speak (Add bystander face, or the A face switch on a zone's row): no balloon covers such a face, where an avoid zone gives way when a panel has no other room. Every mark can be moved with the arrow keys (Shift for larger steps) and removed with Delete; the dialog keeps its own undo, and a speaker outside the safe area is flagged. - Settings. The Design panel's Comics group holds the comics configuration: reading direction and mirrored pictures, the frame and the gutters, the default panel and the named panel styles, the lettering, and the balloon styles, each with a preview of its outline.
- Editor and checks. The text editor colours
:::page,:::strip,::panellines and the keys and attributes of script lines. The Checks panel lists the comic warnings (an unreadable split, panels and cells that do not match, a balloon that does not fit…) at the line they concern; see Comics › Comic warnings.
#Word documents
Manuscripts usually arrive as Word files. The Text panel imports a .docx directly, with no AI agent and nothing to install, and maps its styles the way Place does in InDesign. Import a Word document reads the file in the browser (it is never uploaded) and opens a dialog; the book changes only when you press Import. A file that is not a Word document, such as an old binary .doc, is refused with a message that says so; save it from Word as .docx first.
The dialog has these parts, each of which folds away:
- Quality of the original. A verdict on how the manuscript was prepared: Well styled (it converts cleanly), Partly styled (some paragraphs are formatted by hand) or No styles (everything is in Normal, so the text comes in as plain paragraphs). Under it, the counts (paragraphs, how many are in a style other than Normal, pictures, tables, notes) and what was found, each with the first words of a few paragraphs where it happens: paragraphs with formatting set by hand (fonts, sizes, colours, alignment; it is left out, as the design sets it), short bold paragraphs that look like headings typed by hand, numbers or bullets typed instead of Word lists, manual line breaks, manual page breaks, empty paragraphs used as spacing, tabs and double spaces, tracked changes (insertions are kept and deletions left out; accept or reject them in Word first), comments (not imported), text boxes (their text follows the paragraph each is anchored to), equations (converted to TeX; check them), hidden text and pictures in formats the browser cannot show (EMF, WMF, TIFF).
- Import template. The mapping in use: Automatic (by style name), a saved template, or Saved in this document for a file exported from the Sandbox. Save as a new template asks for a name and keeps the mapping, every style of this document included, in the browser; Save changes updates the selected template; the download button writes it as a
.jsonfile and the upload button loads one, so a whole team can share the same template. Delete asks for confirmation. The template last used is offered first next time. - Paragraph styles. Every paragraph style the document uses, with how many paragraphs use it and the first words of one, and what it becomes: Body text, Heading (a level from 1 to 6 and, when the design has heading styles, one of them), Paragraph style (one of the design's paragraph styles; consecutive paragraphs in it make one
:::paragraphsgroup), Callout (consecutive paragraphs make one box of that type), Callout title (opens a box titled with the paragraph's text), Quote, Caption of the picture or table beside it, Start of a new chapter, Postext Markdown, as written (the text is copied as it is, for directives typed in Word) or Leave out. Paragraphs in Word's numbered and bulleted lists become Postext lists whatever their style, with their numbers and nesting. Poem (:::verse, line by line) sets the style's paragraphs as a:::versepoem, optionally in one of the design's paragraph styles: Shift+Enter breaks a line, a paragraph is a stanza, one-line paragraphs in a row make one stanza and an empty paragraph a stanza break; it is guessed for styles named Verse, Poem or Poesía. - Character styles. The same for character styles: Plain text, Bold, Italic, Bold italic, Small capitals, Superscript, Subscript, Chip (one of the design's chip styles), Postext Markdown, as written or Leave out.
- Options. Manual line breaks (Shift+Enter) are kept as line breaks inside the paragraph (a backslash at the end of the Markdown line, the default), joined with a space or start a new paragraph; bold, italic, small capitals and scripts set by hand are kept or left out; short bold paragraphs stay paragraphs or become headings of a level; manual page breaks are left out (the design turns the pages) or kept as
:::pagebreak; pictures and tables are added as resources or not. - Preview of the Markdown, updated as the mapping changes.
The footer chooses where the text goes: Replace this chapter, New chapters after this one or Replace the whole book; the last two start a chapter at every level-1 heading. Pictures (PNG, JPEG, GIF, WebP, SVG) become figure resources and tables become table resources (header rows, merged cells, column widths and cell fills kept), each placed with ::resource{id="…"} where it was and captioned by a Caption paragraph next to it, its typed label (Figure 3.) left out because Postext numbers resources. Footnotes and endnotes become Postext footnotes ([^1]), Word index entries (XE fields) become :index marks, links stay links and equations become $…$ / $$…$$. A tab in body text becomes :tab with the stop Word set for it (:tab{at=432pt align=end leader="."}), or a bare :tab when the paragraph goes to a paragraph style of the book that has stops of its own; Word's dot, hyphen and middle-dot leaders become ., - and ·, its underscore and heavy leaders a rule. A tab in a heading, a table cell or a note becomes a space.
Before matching styles by name, the automatic mapping recognises Word's own roles in any interface language (heading 1–6, Title, Quote, Caption; table-of-contents, index, header and footer paragraphs are left out) and the design's styles: a Word style called like a paragraph style, callout type, heading style or chip style of the book (by id or name, ignoring case and accents) maps to it.
Export to Word downloads the open chapter, or the whole book, as a .docx for someone to work on in Word. The same template is applied in reverse: headings get Word's heading styles, paragraph styles, callouts, quotes and chips get Word styles of their own (named after the design's styles, Callout: Note, Chip: Key), lists become Word lists, footnotes become Word footnotes and links stay links. :tab becomes a Word tab, a :tab{…} with its own stop is kept as written, and the tab stops of a paragraph style that are set at a length become the tab stops of its Word style, with Word's nearest leader (a stop at 'end' or at a percentage depends on the page Word sets the text on, and is left out). What Word cannot show (front matter, fences, directives, :ref, maths, :index marks, resource lines) is kept as written in the grey Postext Markup styles. A book is exported with a Postext Chapter paragraph at the head of each chapter. The template travels inside the file, so the edited document imports again with the same mapping, as a whole book when it holds chapter paragraphs. Leave the grey text as it is and the text comes back as it went out; footnote labels are renumbered ([^1], [^2]…), which prints the same, and _italic_ comes back as *italic*.
For conversions this dialog does not cover (PDF, PowerPoint, EPUB or IDML sources, reproducing an original's layout rules), use the agent skill.
#Persistence
The Sandbox automatically saves your work to the browser:
- Book and configuration — The chapters, the active chapter and the canvas scope are auto-saved to
localStorageunderpostext-sandbox-book(a single document saved by an earlier version is read frompostext-sandbox-markdownas a one-chapter book and migrated on the first save); the configuration is saved after 1 second of inactivity with defaults stripped so only your overrides are stored, together with its version (postext-sandbox-config-version); a configuration saved before the version existed is read as described under Heading breaks saved by postext 1.4 or earlier below - UI state — The active panel and viewport tab, sidebar width, the Design panel's open group (
postext-sandbox-settings-group), its Show every explanation switch (postext-sandbox-settings-help) and section open states, hidden sample books, canvas zoom/fit/view modes, HTML font scale and column mode, the EPUB tab's rendition (postext-sandbox-epub-layout), and toolbar pin states are all persisted inlocalStorage - Open book — The id of the open book of your own (a project) is stored in
localStorageunderpostext-sandbox-project; the projects themselves (chapters, configuration and resource records; recordversion: 9, the engine'sCONFIG_VERSION, which the working configuration andpostext-config.jsonexports are stamped with too, so each is migrated once when the engine's rules change; single-document records from earlier versions are migrated when read, the heading breaks of records older than version 3, the maths size of records older than version 4, the space under inline figures of records older than version 5, the space around inline figures in boxes, the heading marks, the drop-cap sizes, the room under a colon line and the box cuts of records older than version 6, the breaks at dashes and the breaking of ragged text of records older than version 7, and the splits under a heading, the breaks at compounds' hyphens and the space under the:::paragraphscontainers of records older than version 8 are pinned as described below) live in theprojectsstore of the sandbox's IndexedDB database, and their binary payloads share the blob and font stores with the working document. Payloads are garbage-collected when neither the working document nor any project references them - Edited sample books — Your version of a sample book (its chapters, active chapter, canvas scope, configuration and resource records, with what the sample applied when you opened it) is saved in the
presetDraftsstore of the sandbox's IndexedDB database, one record per sample and content language, and its files are kept by the garbage collection like a project's. Restoring the original deletes it - Sample book covers — The cover taken from the first page of a sample book that ships no thumbnail is kept in the
presetCoversstore of the sandbox's IndexedDB database, one record per sample and content language (see Books panel). A book of your own keeps its cover in its project record. - Saving on the way out — Pending edits are written at once when the page is hidden or closed, when you leave the sandbox through a link (the logo) and before another book opens, rather than after the 1-second pause
- Open sample book — The id of the last loaded preset is stored in
localStorageunderpostext-sandbox-preset, so the panels' Reset buttons keep restoring that preset across sessions (a preset that is no longer served shows as unavailable). What that preset applied — its bundle fingerprint plus hashes of the markdown, configuration and resource set — is stored underpostext-sandbox-preset-applied, which is how the next visit tells an untouched document from an edited one - Resources and fonts — Resource records, their binary blobs (bitmaps and SVGs), and custom font files persist in IndexedDB; when IndexedDB is unavailable (e.g. some private-browsing modes), a storage unavailable warning appears in the Checks panel (under Browser)
- Permalink — The URL fragment names what is on screen, so a reload, a bookmark or a link passed to someone else lands on the same page of the same book in the same viewer:
#preset=bioquimica-feduchi&lang=es&view=canvas&chapter=1&page=7opens the Bioquímica preset in Spanish on the Canvas tab at chapter 1, page 7 (the number printed on the page).viewiscanvas,pdf,folio,htmlorepub; on the Folio tab the page is the right-hand page of the open spread. A local project is named asproject=ID— its storage id, so only the browser holding the project can follow such a link. The sandbox keeps the fragment current as you switch books, tabs and chapters and as you scroll. A part left out means whatever is there (no page: the chapter's first page; no book: the one last open), and a book the browser cannot open is passed over. Pasting a link into the address bar of an open sandbox opens it in place. When the page is opened on a link to another book than the one last open, the sandbox shows its loading state until the linked book is in, never the previous one. A host can also link to books of its own with thehashBundlesprop (see Props): the website opens a Cookbook recipe with#recipe=<slug>&lang=es. The first visit imports the recipe's.postextfile as one of your books. A later visit of the same link asks first (You already have this book): Open my copy opens that book, your edits included, and Replace with the published version imports the recipe afresh, which may have been corrected since, and deletes your copy once the new one is open; Escape keeps your copy. The fragment then names the project. The interface language stays in the path (/en/sandbox,/es/sandbox);langis the content language of a bilingual bundle, any BCP 47 tag, kept in canonical case (lang=zh-hantreadszh-Hant). A tag the bundle does not list opens the edition that serves it:zh-TWandzh-HKopen the Traditional Chinese one (zh-Hant),zhandzh-CNthe Simplified one (zh-Hans),en-GBthe English one. The other Chinese script is read only when the bundle has no edition in the reader's: azh-TWlink to a book inzh-Hansand English opens the Simplified text, not the English. A link withoutlangopens the bundle'sopenLocalewhen it names one, else the edition in the interface language. The chapter and page of a link apply to the edition it opens, and the fragment then names that edition by its own tag (lang=zh-TW&chapter=28becomeslang=zh-Hant&chapter=28).
Heading breaks saved by postext 1.4 or earlier. Up to postext 1.4, a configuration with a headings object laid its level-1 headings out with no page break unless it set the H1 Break before switch explicitly (and saving dropped a switched-off H1 break), a partial H1 break took its missing field from the no-break default, and a heading style's break did the same instead of merging onto its level's. The engine now keeps each level's default — H1 opens on a fresh recto (always-odd) — and merges a partial break onto it. So that a book saved then keeps the pages it had, the Sandbox writes those breaks out when it reads a project record older than version 3 or an unversioned working configuration: enabled: false on H1 where the break was off, and parity: 'any' beside an enabled: true that named no parity, on H1 and on heading styles. The Design panel then shows the break the pages were laid out with. Files record the version too since postext 1.5: a .postext file whose manifest has no configVersion, and a postext-config.json with none, were written by postext 1.4 or earlier, and are read the same way when they are imported or opened (see Bundles written by postext 1.4 or earlier).
Maths size saved before postext 1.5. Up to postext 1.4 every formula came out 1.131 times larger than its Size scale says (see Formula size). So that a book saved then keeps its pages, the Sandbox pins that size when it reads a project record older than version 4, a working configuration saved under an older stamp (or none), a .postext file whose manifest is older than configVersion: 4, or a postext-config.json exported before it: Size scale becomes the saved scale × 1.1312 and a display margin in em is divided by 1.1312, so the formulas and the space around them stay as they were. A book whose chapters have no $ is left as it was (a postext-config.json carries no chapters, so its size is pinned whenever maths is on), and so is one with Enable LaTeX off. The Formulas section then shows the values the book is laid out with; reset Size scale, Display margin top and Display margin bottom to set it at today's size. The pin is written once: the record is saved again under the current version and read as it is from then on. A preset applied then and never edited still counts as untouched (the Sandbox compares it with its pinned values, and this holds for the heading-break pin too): reloading it or switching books does not ask to discard edits you never made, and a newer version of the preset, such as the built-in guide's, still replaces it.
Inline figures saved before postext 1.5. Up to postext 1.4 a figure or table set inline in the text (placement Inline (here)) kept a line of space above it only: the text after it resumed at the next grid line, however close that was. It now keeps the same line below it (Columns → Space around inline figures, Above and below). So that a book saved then keeps its pages, the Sandbox sets Space around inline figures to Above only when it reads a project record older than version 5, a working configuration saved under an older stamp (or none), a .postext file whose manifest is older than configVersion: 5, or a postext-config.json exported before it, when a line of the book embeds a resource — ::resource{id="…"} alone on its line, not a mention in the text. A postext-config.json carries no chapters, so there it is set whenever the file is older. Choose Above and below to lay the book out with today's spacing.
Inline figures in boxes saved before postext 1.5. Up to postext 1.4 a figure or table set inline inside a box sat right against the box text around it. It now keeps a line of the box text above it, and below it too with Above and below (Columns → Space around figures in boxes). So that a book saved then keeps its pages, the Sandbox switches Space around figures in boxes off when it reads a project record older than version 6, a working configuration saved under an older stamp (or none), a .postext file whose manifest is older than configVersion: 6, or a postext-config.json exported before it, when a box of the book embeds a resource on a line of its own. A postext-config.json carries no chapters, so there it is switched off whenever the file is older. Switch it on to lay the book out with today's spacing.
Heading marks and drop caps saved before postext 1.5. Up to postext 1.4 a heading printed the words of its *italic*, **bold** and other marks in its own plain style, and a drop cap with no size was as tall as all the lines it spans, its top above the first line. A heading now sets its marks (Headings → Inline marks in headings), and a drop cap's top is level with the capitals of the first line. So that a book saved then keeps its pages, the Sandbox turns Inline marks in headings off when it reads a project record older than version 6, a working configuration saved under an older stamp (or none), a .postext file whose manifest is older than configVersion: 6, or a postext-config.json exported before it, when a heading of the book carries a mark (a postext-config.json carries no chapters, so there it is turned off whenever the file is older); and it writes the size each drop cap was set at into its Drop cap size. Turn the switch on, or clear the size, to set the book with today's rules. Mind that an italic heading whose whole title is marked *…* then comes out upright.
Lists after a colon saved before postext 1.5. Up to postext 1.4 Keep colon with list took one line of room under the line ending in a colon as enough for the list, so a two-line first item that the orphan and widow rules keep whole went on to the next column and left the colon line alone at the foot. It now asks for the room the first item needs (Typography → Body text → Widows, orphans and short lines → Room Under the Colon, What the first item needs). So that a book saved then keeps its pages, the Sandbox sets Room Under the Colon to One line (1.4) when it reads a project record older than version 6, a working configuration saved under an older stamp (or none), a .postext file whose manifest is older than configVersion: 6, or a postext-config.json exported before it, when a list of the book follows a line ending in a colon. A postext-config.json carries no chapters, so there it is set whenever the file is older. Choose What the first item needs to lay the book out with today's rule.
Box cuts saved before postext 1.5. Up to postext 1.4 a box that split inside a paragraph or list item could leave one line of it on a side, as long as each side of the box held its Lines kept on each side of a split. A cut now leaves at least two lines of the paragraph or item on each side (Columns → Lines of a paragraph at a box cut). So that a book saved then keeps its pages, the Sandbox sets Lines of a paragraph at a box cut to 1 when it reads a project record older than version 6, a working configuration saved under an older stamp (or none), a .postext file whose manifest is older than configVersion: 6, or a postext-config.json exported before it, when a chapter of the book opens a :::callout. A postext-config.json carries no chapters, so there it is set whenever the file is older. Set it back to 2 to lay the book out with today's rule.
Dashes and ragged text saved before postext 1.5. Up to postext 1.4 optimal line breaking never ended a line after an em or en dash set closed between words (say—that’s), and ragged text was always set line by line, each line filled before the next. A line may now end after such a dash (Typography → Body text → Paragraphs → Break After Dashes), and ragged running text is broken with Knuth-Plass too (Optimal Breaking of Ragged Text). So that a book saved then keeps its pages, the Sandbox switches Break After Dashes off when it reads a project record older than version 7, a working configuration saved under an older stamp (or none), a .postext file whose manifest is older than configVersion: 7, or a postext-config.json exported before it, when a chapter of the book sets such a dash (a postext-config.json carries no chapters, so there it is switched off whenever the file is older); and it switches Optimal Breaking of Ragged Text off when the configuration sets some running text ragged: the body text, a paragraph style, a box body, the body of a part or the body of a section style. Switch them on to lay the book out with today's rules.
Splits under a heading saved before postext 1.5. Up to postext 1.4 the paragraph under a heading at the foot of a column kept as many lines as fit there, however few went on to the next column. It now keeps the orphan minimum too, or the heading moves on with it (Headings & contents → Headings → Split Under a Heading). So that a book saved then keeps its pages, the Sandbox sets Split Under a Heading to Fill the column when it reads a project record older than version 8, a working configuration saved under an older stamp (or none), a .postext file whose manifest is older than configVersion: 8, or a postext-config.json exported before it, when a chapter of the book has a heading (a postext-config.json carries no chapters, so there it is set whenever the file is older) and the configuration keeps Keep With Next and orphan control on. Set it to By the rules to lay the book out with today's rule.
Paragraph containers saved before postext 1.5. Up to postext 1.4 the space under a :::paragraphs container was the style's own (the larger of its space between paragraphs and its bottom margin), set under the last line before the text snapped back to the grid; the space a heading keeps above itself was added under it, and the body's paragraph spacing did not count, so a heading sat further from a bibliography than from a paragraph, and the paragraph after a group of tight entries sat closer to it than to any other. The space now merges with the next block's own and is at least the text's paragraph spacing (Typography → Paragraph styles → Space under a container, Collapse). So that a book saved then keeps its pages, the Sandbox sets Space under a container to Add (1.4) when it reads a project record older than version 8, a working configuration saved under an older stamp (or none), a .postext file whose manifest is older than configVersion: 8, or a postext-config.json exported before it, when the configuration declares a paragraph style and a chapter of the book opens a :::paragraphs container. A postext-config.json carries no chapters, so there it is set whenever the file is older and declares a paragraph style. Choose Collapse to lay the book out with today's rule.
Compounds saved before postext 1.5. Up to postext 1.4 optimal line breaking never ended a justified line after the hyphen of a compound (well-known) in a paragraph without bold, italics or other formatting, while it did in one with formatting. A line may now end there in every paragraph (Typography → Body text → Paragraphs → Break After Hyphens). So that a book saved then keeps its pages, the Sandbox switches Break After Hyphens off when it reads a project record older than version 8, a working configuration saved under an older stamp (or none), a .postext file whose manifest is older than configVersion: 8, or a postext-config.json exported before it, when a chapter of the book sets a hyphen between two letters (a postext-config.json carries no chapters, so there it is switched off whenever the file is older). Switch it on to lay the book out with today's rule.
Poems and hanging styles saved before postext 1.23. Up to postext 1.22 a :::verse poem whose lines carried no || was set as single hemistichs, each line centred, and a paragraph style's hanging indent replaced its first-line indent. Such a poem is now set line by line (Typography → Body text → Verse → Poems Without Separator, Line by line), and a style that sets both indents starts its first line at the first-line indent. So that a book saved then keeps its pages, the Sandbox sets Poems Without Separator to As hemistichs (1.22) when it reads a project record older than version 9, a working configuration or a postext-config.json export stamped below 9 whose chapters hold such a poem, and drops the first-line indent of a style that also hangs. It also switches Forced Line Breaks (Typography → Body text → Paragraphs) off when the chapters of such a record end a line with a backslash or set \\ before a space, which printed up to postext 1.22 (for a postext-config.json export, which carries no chapters, always). And it switches Code fences (Typography → Code) off when the chapters hold a ``` or ~~~ fence, whose lines were read as Markdown up to postext 1.22 (for an export, always).
Poems saved with postext 1.23. In postext 1.23 a line of a poem set line by line that was even a little wider than the measure turned over. It now tightens its word spaces, down to the minimum word spacing, and stays on one line when that is enough (Typography → Body text → Verse → Tighten Before Turning Over). So that a book saved then keeps its pages, the Sandbox switches Tighten Before Turning Over off when it reads a project record, a working configuration or a postext-config.json export stamped 9 or below whose chapters set a poem line by line (for an export, which carries no chapters, always).
Design texts saved with postext 1.23. Up to postext 1.23 a text element of a heading design or a part page that set no overflow was cut to one line with an ellipsis. It now wraps onto more lines, and Add text leaves Overflow to the slot. So that a book saved then keeps its pages, the Sandbox sets Overflow to Ellipsis at the end (…) on each of those elements when it reads a project record, a working configuration, a .postext file or a postext-config.json export stamped 9 or below.
Inline tables and columns saved with postext 1.24. Up to postext 1.24 a table placed here that did not fit the rest of its column moved whole to the next one, a :::columns fence outside a box was ignored, and a box never cut inside a :::columns group. Now the table is cut between rows and the group sets its blocks in columns and goes on in the next column or page. So that a book saved then keeps its pages, the Sandbox switches Apply to tables set in the text (Tables) off when it reads a project record, a working configuration or a postext-config.json export stamped below 11 whose chapters embed a resource, and Columns in the text, and groups that split (Columns) off when they hold a :::columns fence (for an export, which carries no chapters, always).
These pins hold back what each of those rule changes would move. Version 1.5 also fixes layout bugs, and a fix has no pin, so a saved book can still see a page move where one of them applies: the band of a page-wide chapter heading without a design, a drop cap in a heading design, a paragraph in a box, a loose paragraph that balancing stretches, a floated box with a margin wider than a line, a centred or right-aligned running head with tracking, the second column under a page-wide opener, a running head taken from a heading broken after a hyphen, a word wider than its line cut next to its own hyphen, the rest of a word wider than its line, which now keeps its own break points, the item after a list nested in another (see Formula size for the list).
Storage is shared across UI locales. A pristine default document swaps to the current locale's default markdown and reseeds the example resources when the locale changes — so opening the Spanish sandbox shows Spanish examples. Any user edit opts the document out of this behavior. All previews also derive a hyphenation locale from the UI locale when the configuration names no language (neither a hyphenation locale nor locale).
#Export and import
A whole book travels as a .postext file: a zip archive with exactly the layout of a preset bundle directory — preset.json, chapters/*.md, resources/* and fonts/* (see Preset bundle format). The archive also carries the book's pagination as layouts.json — each chapter's page count and numbering, stamped with the engine version, configuration and resources it was built with — so an imported book opens paginated and only what those stamps no longer vouch for is laid out again. A bundle in several languages sets each with its own configuration, so it may carry one per language instead, layouts.<locale>.json (layouts.zh-Hant.json), read before layouts.json. The active document exports the pagination it holds; a project or preset exported from its row carries the one recorded while it was last the working book. A cover image is written as the manifest's thumbnail, so it survives the round trip. The Books panel's New menu (Open a .postext file…) imports a file as a new book; every row's ⋯ menu has its own Download (.postext), and the open book's exports the working document. Files written by earlier versions (a version 1 manifest with a single document.md) import as a one-chapter book. A book in one language keeps the figure and table labels of that language whatever the interface language: a Spanish file opened from /en/sandbox prints Figura and Tabla unless its configuration names other resource types. The language is the one the file names or, when it names none, the one its configuration sets (locale, then the hyphenation language). Import accepts the files at the archive root or under one top-level folder (as produced by zipping the folder itself; __MACOSX entries and dotfiles are ignored). Fonts are written as separate files, never inside config.customFonts; .woff faces are skipped with a warning both ways, as are resources whose bytes are missing. Unzip an exported file into <presets-root>/<dir>/ and add an index.json entry to serve it as a preset.
The same files are read and written by the postext package (openBundle, createBundle, buildBundle; see Bundles). A book exported here opens in your own program, and a book your program writes opens here. That makes the Sandbox a place to inspect and fine-tune what a program lays out: export it from the program, import it here, fix it with the live preview, export it again and load it back in the program. The agent skill delivers its ports as .postext files too.
The text and the design also export separately from the Text and Design panel headers.
The Design panel header downloads postext-config.json with defaults stripped:
{
"type": "postext-config",
"version": 1,
"config": { ... }
}The Text panel header downloads the active chapter as a plain .md file and its Import button replaces the active chapter with a .md file's contents. The Design panel's Import button opens a file picker for .json files validated against the expected type and version; invalid files are silently ignored. The postext-markdown.json wrapper and the combined postext-sandbox.json format from earlier versions no longer exist.