Origami Text Creation

Here’s what an existing EPUB exporter needs to change or add for Origami Text:

Structural constraints (things to remove or restrict):

Split your content into multiple XHTML files? Stop. Origami Text uses a single paper.html. The spine has one entry.

Multiple stylesheets, inline styles, or style attributes on elements? Remove them all. At most one style.css, linked from the head. The document must be readable without it.

Any layout CSS — floats, positioning, flexbox, grid, background images, decorative elements? Remove. The stylesheet handles only typography and spacing.

JavaScript in the content document? Remove entirely. The only <script> permitted is the inert type="application/json" block for Visual-Meta.

Structural additions (things to add):

Hierarchical IDs on every addressable element. Every heading, paragraph, figure, list item, and table gets an id attribute following a hierarchical scheme. Section 3’s heading is id="3", the second element under it is id="3B", third is id="3C", and so on. Letters for elements within sections, numbers for sections.

Structured citation data on reference entries. Each bibliography entry carries data-bibtex and data-csl-json attributes containing the machine-readable citation data for that reference. Inline citations are <a> elements linking by fragment to the corresponding reference entry’s id.

Defined concepts markup. Terms the author has defined carry a data-concept and data-definition attribute, typically on a <dfn>element.

Inline Visual-Meta. A <script type="application/json" id="visual-meta"> block at the end of the document body containing the full metadata payload — document metadata, citation data, defined concepts, and spatial layout views.

Standalone Visual-Meta file. A visual-meta.json file at the package root containing the same data as the inline block. Listed in the OPF manifest as application/json but not included in the spine.

Spatial layout data inside the Visual-Meta. Named arrays of nodes, each consisting of a ref (matching an element id in paper.html) and xyz coordinates in metres, right-handed Y-up. Multiple named views are permitted. This is what an XR reader uses to reconstruct the author’s spatial arrangement.

Things that stay the same:

mimetypecontainer.xml, and package.opf structure are standard EPUB 3. The nav element with epub:type="toc" is standard. Image handling (PNG/JPEG in <figure> elements) is standard. The file is a zip archive with mimetype stored uncompressed and first. EPUBCheck should validate the result as a conforming EPUB 3 document.

In summary, the implementation difference is: constrain the HTML to semantic-only single-file output, add hierarchical id attributes throughout, add data- attributes on citations and defined terms, and include the Visual-Meta as both inline JSON and a standalone file. Everything else is standard EPUB 3 that your exporter already handles.