Origami Reader: macOS Application Specification

Version 0.1 — Draft for Development Planning


1. Purpose

Origami Reader is a free, open-source macOS application that reads standard EPUB 3 documents and, when it detects Origami metadata, unlocks enhanced capabilities: citation interaction, deep addressable linking, key sentence navigation, metadata inspection, and spatial/Map views. The reader must work well as a plain EPUB reader first — the Origami features are progressive enhancements, not prerequisites.


2. Design Principles

Graceful detection, not gatekeeping. The reader opens any valid EPUB 3. If the origami-meta/ directory is present, additional UI surfaces become available. If not, the user sees a clean, competent EPUB reader.

The document is the source of truth. All metadata, citations, addresses, and layout data come from the EPUB itself. The reader never requires an internet connection to function (though it may optionally fetch linked documents or resolve DOIs online).

Minimal chrome, maximum text. Following the Origami philosophy: the reading surface is deliberately plain. Visual complexity is the reader’s responsibility, applied on the fly to suit the user — not baked into the document.

Local-first library. The reader maintains an index of all Origami EPUBs on the user’s machine. This enables document-to-document citation linking: if a cited work exists locally, the reader can open it to the cited passage.


3. Architecture Overview

┌──────────────────────────────────────────────────┐
│                   Origami Reader                  │
├──────────────────────────────────────────────────┤
│  UI Layer (SwiftUI)                              │
│  ├── Library View                                │
│  ├── Reading View (WKWebView)                    │
│  ├── Citation Panel                              │
│  ├── Metadata Inspector                          │
│  ├── Map / Spatial View                          │
│  └── Search & Navigation                         │
├──────────────────────────────────────────────────┤
│  Document Engine                                 │
│  ├── EPUB Parser (ZIP + OPF + XHTML)             │
│  ├── Origami Detector (checks for origami-meta/) │
│  ├── Citation Index                              │
│  ├── Address Resolver                            │
│  ├── ID Map Loader                               │
│  └── Spatial Layout Engine                       │
├──────────────────────────────────────────────────┤
│  Library Index                                   │
│  ├── Local document catalogue (SQLite or JSON)   │
│  ├── Citation cross-reference graph              │
│  └── Full-text search index                      │
└──────────────────────────────────────────────────┘

Platform: macOS 14+ (Sonoma), Swift, SwiftUI for application chrome, WKWebView for EPUB content rendering.

Why WKWebView: EPUB content is XHTML + CSS. WKWebView provides a mature, standards-compliant rendering engine with full CSS support, JavaScript interop for interactive features, and accessibility support (VoiceOver) built in. This avoids building a custom text layout engine. The reading experience is a local web view loading content from the EPUB’s XHTML files with injected JavaScript for Origami interactions.


4. Feature Specification

4.1 — Core EPUB Reading (Works for any EPUB 3)

4.1.1 — Document opening and parsing

  • Open .epub files via File > Open, drag-and-drop, or double-click (register as handler for .epub UTI)
  • Parse the ZIP container, locate META-INF/container.xml, resolve the OPF package path
  • Parse the OPF manifest, metadata, and spine
  • Load the navigation document (nav.xhtml) for the table of contents
  • Support multi-file EPUBs (multiple XHTML spine items) with seamless scroll or paginated view

4.1.2 — Reading view

  • Render EPUB XHTML content in a WKWebView
  • Scrolling mode (default) and optional paginated mode
  • User-adjustable font size, font family, line spacing, and margins
  • Light mode, dark mode, and sepia reading themes
  • Remember reading position per document

4.1.3 — Navigation

  • Table of Contents sidebar (from nav.xhtml), collapsible
  • In-document search (Cmd+F) with result highlighting and navigation
  • Keyboard navigation: arrow keys for scrolling, Cmd+Up/Down for chapter boundaries

4.1.4 — Accessibility

  • Full VoiceOver support: the XHTML content is inherently accessible via WKWebView
  • Respect system text size preferences
  • High contrast mode support
  • Keyboard-navigable UI throughout

4.1.5 — Library view

  • Grid or list view of all EPUBs the user has opened or imported
  • Display cover image (if present in EPUB), title, author, last-read date
  • Sort by title, author, date added, last read
  • Search across library by title and author
  • Import via drag-and-drop of .epub files or a watched folder

4.2 — Origami Detection and Enhanced Features

4.2.1 — Origami detection

On opening any EPUB, check for the presence of the origami-meta/ directory in the EPUB ZIP. If found, parse:

  • origami-meta/visual-meta.json → document identity and self-citation
  • origami-meta/citations.json → citation database
  • origami-meta/glossary.json → defined concepts
  • origami-meta/spatial-layout.json → Map/XR layout data
  • origami-meta/id-map.json → unified ID cross-reference table

If any of these files are present, activate the corresponding UI features. Missing files simply mean that feature is unavailable — never an error.

Display a subtle indicator in the toolbar (a small origami icon or badge) showing the document is Origami-enhanced.

4.2.2 — Addressable linking (Purple Numbers)

Every paragraph, heading, and list item in an Origami EPUB has an id attribute (e.g. id="ot-042").

  • Deep linking: The reader supports opening a document to a specific address via a URL scheme: origami://open?file=[path]&anchor=ot-042. This scrolls directly to the addressed element and briefly highlights it.
  • Copy address: Right-click or long-press any paragraph to access “Copy Address” — copies a deep link to that specific element.
  • Address display: Optionally show the current element’s ID in a subtle status bar indicator, so the user always knows where they are in the address space.

4.2.3 — Citation interaction

This is the flagship Origami reader feature.

In-document citation links: In the XHTML, citation references are marked with class="origami-cite" and data-cite-id="[UUID]". Inject JavaScript into the WKWebView that intercepts clicks/taps on these elements.

On click/tap of a citation:

Display a citation popover containing:

  • Full bibliographic entry (title, authors, year, journal, volume, pages)
  • DOI link (clickable, opens in browser)
  • URL link if present
  • Abstract if present in the metadata
  • A “Copy BibTeX” button
  • A “Copy Citation” button (formatted per the document’s citation style from Version.plist)
  • “Open Source Document” button — this is the key feature (see 4.2.4)

Citation panel (sidebar): A toggleable right sidebar listing all citations in the document, grouped by order of appearance or alphabetically (user toggle). Each entry is clickable and scrolls to the first in-text reference. Provides a search/filter field at the top.

4.2.4 — Document-to-document linking

When the user clicks “Open Source Document” on a citation:

  1. Check the local library index for a document matching the citation. Match by: DOI (exact), title (fuzzy), or vm-id if present.
  2. If found locally, open that document in a new reading window. If the citation includes a data-cite-anchor attribute (pointing to a specific passage in the source), scroll to that anchor.
  3. If not found locally, offer: “This document is not in your library. Search online?” — which opens a DOI resolver or a web search for the title.

Library citation graph: The library index maintains a cross-reference: for every citation in every Origami document, record {citing_doc, cited_doc, anchor}. This enables a “Cited By” view: when reading a document, the user can see which other documents in their library cite it.

4.2.5 — Key sentence navigation

Origami documents mark key/thesis sentences with class="key-sentence". The reader provides:

  • Key sentence highlighting: A toggle (toolbar button or keyboard shortcut) that visually highlights all key sentences in the document with a subtle background colour.
  • Key sentence navigator: A compact panel or popover listing all key sentences in order, functioning as an argumentative outline. Clicking any entry scrolls to it.
  • Summary generation prompt: A “Copy Key Sentences” action that copies all key sentences as a bullet list — useful for notes, review, or as an LLM prompt.

4.2.6 — Metadata inspector

A toggleable panel (Cmd+I) showing:

  • Document’s own BibTeX entry (from visual-meta.json self_citation)
  • Author, title, institution, export date, Author app version
  • Origami format version
  • Count of addressable elements, citations, glossary entries
  • A “Copy Self-Citation BibTeX” button for easy citing of this document

4.2.7 — Glossary / Defined Concepts

If glossary.json is present:

  • Terms marked in the body (matched by phrase) show a dotted underline on hover
  • Click/tap opens a popover with the definition and, if present, links to the defining passage (via internal_anchor)
  • A toggleable Glossary panel lists all defined terms alphabetically

4.3 — Map / Spatial View

This is the feature that distinguishes Origami Reader from every other EPUB reader. It provides a 2D (and eventually 3D/XR) spatial view of the document’s structure, relationships, and discourse position.

4.3.1 — 2D Map view (macOS launch feature)

Data source: origami-meta/spatial-layout.json.

Display:

  • A canvas view (SwiftUI Canvas or an AppKit-backed custom view) showing nodes as cards/boxes with connecting lines/edges
  • Each node displays its label (heading text, concept name, or citation short reference)
  • Nodes are colour-coded by type: section headings, glossary concepts, citations
  • Connections (from the connections array in the layout JSON) are rendered as lines between nodes, optionally with labels

Interaction:

  • Click a node → scroll the reading view to the corresponding passage (resolved via content_anchor in the unified ID table)
  • Drag nodes to reposition (positions stored locally, not modifying the EPUB)
  • Zoom and pan with trackpad gestures
  • Toggle node types on/off (show only headings, only citations, etc.)

Layout:

  • If the spatial-layout JSON includes populated position data from Author’s Map view, use those positions
  • If positions are empty/zeroed (as in the sample document), apply an automatic layout algorithm: hierarchical top-down for sections, force-directed for citation networks, or concentric rings with the document at centre

4.3.2 — Future: XR / visionOS spatial view

The spatial-layout JSON is designed to carry 3D position data (xyz). The macOS reader uses only x and y. A future visionOS port would use all three axes to place document nodes in immersive space. The JSON format should be designed now with this in mind — hence the z coordinate even in the macOS version.


4.4 — Search and Discovery

4.4.1 — In-document search Standard Cmd+F search with result highlighting, forward/back navigation, and result count.

4.4.2 — Cross-library search Search across all documents in the library. Returns results grouped by document, with snippets showing context. Uses a full-text search index (SQLite FTS5 recommended) built at import time.

4.4.3 — Citation search Search specifically within citation metadata across the library: find all documents that cite a given author, contain a given DOI, or reference a given title.


5. Data Model

5.1 — Library Index (SQLite)

-- Documents table
CREATE TABLE documents (
    id TEXT PRIMARY KEY,           -- UUID
    file_path TEXT NOT NULL,
    title TEXT,
    authors TEXT,                  -- JSON array of author names
    is_origami BOOLEAN DEFAULT 0,
    date_added TEXT,               -- ISO 8601
    date_last_read TEXT,
    last_position TEXT,            -- anchor ID of last reading position
    cover_image_path TEXT
);

-- Citations table (populated only for Origami documents)
CREATE TABLE citations (
    id TEXT PRIMARY KEY,           -- citation UUID from the EPUB
    document_id TEXT REFERENCES documents(id),
    title TEXT,
    authors TEXT,                  -- JSON array
    year INTEGER,
    doi TEXT,
    url TEXT,
    journal TEXT,
    bibtex_type TEXT,
    abstract TEXT,
    bibtex_raw TEXT
);

-- Cross-references: which document cites which citation
CREATE TABLE citation_refs (
    citing_document_id TEXT REFERENCES documents(id),
    citation_id TEXT REFERENCES citations(id),
    anchor TEXT,                   -- ot-NNN anchor where the citation appears
    PRIMARY KEY (citing_document_id, citation_id, anchor)
);

-- Full-text search
CREATE VIRTUAL TABLE document_fts USING fts5(
    document_id,
    title,
    content,                       -- full text extracted from XHTML
    tokenize='porter'
);

-- Glossary terms (populated only for Origami documents)
CREATE TABLE glossary_entries (
    id TEXT PRIMARY KEY,
    document_id TEXT REFERENCES documents(id),
    phrase TEXT,
    description TEXT,
    anchor TEXT                    -- ot-NNN anchor of the defining passage
);

5.2 — Document-to-document resolution

When the user clicks “Open Source Document” on a citation, resolve by:

  1. DOI match (exact): SELECT d.* FROM documents d JOIN citations c ON c.document_id = d.id WHERE c.doi = ? — but search for the DOI as a citation of the source, not just within the current document. In practice: search the documents table for any Origami document whose self-citation (from visual-meta.json) has a matching DOI.
  2. Title match (fuzzy): normalise both strings (lowercase, strip punctuation, collapse whitespace) and compare. Use FTS5 for this.
  3. If no local match: offer to search online via https://doi.org/[DOI] or https://scholar.google.com/scholar?q=[title].

6. JavaScript Bridge (WKWebView ↔ Swift)

The reading view injects JavaScript into the loaded XHTML to handle Origami interactions. Communication uses WKScriptMessageHandler.

6.1 — Injected JavaScript (origami-reader.js)

// Injected into every EPUB XHTML page on load

// Citation click handler
document.querySelectorAll('.origami-cite').forEach(el => {
    el.addEventListener('click', (e) => {
        e.preventDefault();
        const citeId = el.getAttribute('data-cite-id');
        const rect = el.getBoundingClientRect();
        window.webkit.messageHandlers.origamiCite.postMessage({
            action: 'showCitation',
            citationId: citeId,
            x: rect.left + rect.width / 2,
            y: rect.top
        });
    });
});

// Key sentence highlighting toggle
function toggleKeySentences(show) {
    document.querySelectorAll('.key-sentence').forEach(el => {
        el.style.backgroundColor = show ? 'rgba(255, 220, 100, 0.25)' : 'transparent';
    });
}

// Scroll to anchor (called from Swift side)
function scrollToAnchor(anchorId) {
    const el = document.getElementById(anchorId);
    if (el) {
        el.scrollIntoView({ behavior: 'smooth', block: 'center' });
        el.style.transition = 'background-color 0.3s';
        el.style.backgroundColor = 'rgba(100, 150, 255, 0.2)';
        setTimeout(() => { el.style.backgroundColor = 'transparent'; }, 2000);
    }
}

// Report current reading position (debounced scroll handler)
let scrollTimer;
window.addEventListener('scroll', () => {
    clearTimeout(scrollTimer);
    scrollTimer = setTimeout(() => {
        // Find the topmost visible element with an id starting with 'ot-'
        const elements = document.querySelectorAll('[id^="ot-"]');
        for (const el of elements) {
            const rect = el.getBoundingClientRect();
            if (rect.top >= 0 && rect.top < window.innerHeight / 2) {
                window.webkit.messageHandlers.origamiPosition.postMessage({
                    action: 'positionUpdate',
                    anchor: el.id
                });
                break;
            }
        }
    }, 300);
});

// Glossary term hover
document.querySelectorAll('.origami-glossary').forEach(el => {
    el.addEventListener('click', (e) => {
        const termId = el.getAttribute('data-glossary-id');
        const rect = el.getBoundingClientRect();
        window.webkit.messageHandlers.origamiGlossary.postMessage({
            action: 'showDefinition',
            glossaryId: termId,
            x: rect.left + rect.width / 2,
            y: rect.top
        });
    });
});

6.2 — Swift message handlers

Register in the WKWebView configuration:

let contentController = WKUserContentController()
contentController.add(self, name: "origamiCite")
contentController.add(self, name: "origamiPosition")
contentController.add(self, name: "origamiGlossary")

// Inject the Origami reader JavaScript
let script = WKUserScript(source: origamiJS, injectionTime: .atDocumentEnd, forMainFrameOnly: true)
contentController.addUserScript(script)

7. URL Scheme

Register origami:// as a custom URL scheme.

Supported actions:

URLAction
origami://open?file=/path/to/doc.epubOpen document
origami://open?file=/path/to/doc.epub&anchor=ot-042Open to specific passage
origami://open?doi=10.1007/s12109-015-9404-9Open by DOI (search local library first)
origami://cite?id=C3736192&from=/path/to/source.epubOpen cited document from a source context

This enables Origami documents to link to each other via standard URLs, and for external tools (including Author itself) to deep-link into the reader.


8. UI Layout

8.1 — Main window

┌─────────────────────────────────────────────────────────┐
│ ◀ ▶  [Title]               🔍  📑  🗺  ℹ️  ⚙️          │ ← Toolbar
├─────────┬───────────────────────────────┬───────────────┤
│         │                               │               │
│  TOC    │     Reading View              │  Citation     │
│  Panel  │     (WKWebView)               │  Panel        │
│         │                               │  (toggleable) │
│  -------│                               │               │
│  Key    │                               │               │
│  Sents  │                               │               │
│  (opt.) │                               │               │
│         │                               │               │
├─────────┴───────────────────────────────┴───────────────┤
│  ot-042  │  Origami Enhanced  │  Position 42/187        │ ← Status bar
└─────────────────────────────────────────────────────────┘

Toolbar icons:

  • 📑 Toggle TOC sidebar
  • 🗺 Toggle Map/Spatial view
  • ℹ️ Toggle Metadata inspector
  • 🔍 Search
  • ⚙️ Reading preferences (font, size, theme)
  • Origami badge (only visible for Origami-enhanced documents)

Sidebars:

  • Left sidebar: TOC (always available), with Key Sentences section below (Origami only)
  • Right sidebar: Citation Panel (Origami only)
  • Both collapsible independently

8.2 — Map view

The Map view replaces the reading view when toggled (or opens in a split/new window at user preference).

┌─────────────────────────────────────────────────────────┐
│ ◀ ▶  [Title] — Map View    🔍  📖  🗺  ℹ️  ⚙️          │
├─────────────────────────────────────────────────────────┤
│                                                         │
│    ┌──────────────┐         ┌───────────────┐           │
│    │  §1 Why      │────────▶│  Halevi 2015  │           │
│    │  Formats     │         └───────────────┘           │
│    │  Fall Short  │                                     │
│    └──────┬───────┘         ┌───────────────┐           │
│           │                 │  Kumar 2024   │           │
│    ┌──────▼───────┐    ┌───▶│  (PDF access) │           │
│    │  §2 The      │    │    └───────────────┘           │
│    │  Origami     │    │                                │
│    │  Approach    │────┘    ┌───────────────┐           │
│    └──────┬───────┘         │  Taylor 2024  │           │
│           │            ┌───▶│  (EPUB3)      │           │
│    ┌──────▼───────┐    │    └───────────────┘           │
│    │  §3 AI       │────┘                                │
│    │  Fidelity    │                                     │
│    └──────────────┘                                     │
│                                                         │
├─────────────────────────────────────────────────────────┤
│  Filter: [All] [Sections] [Citations] [Concepts]  Zoom  │
└─────────────────────────────────────────────────────────┘

Clicking any node in the Map switches back to Reading View scrolled to the corresponding passage.

8.3 — Library view

┌─────────────────────────────────────────────────────────┐
│  Origami Reader — Library              🔍  ⊞ ≡  ⚙️     │
├─────────────────────────────────────────────────────────┤
│                                                         │
│  ┌─────────┐  ┌─────────┐  ┌─────────┐  ┌─────────┐   │
│  │ ◇       │  │         │  │ ◇       │  │         │   │
│  │ Origami │  │ Other   │  │ Another │  │ Plain   │   │
│  │ Text    │  │ EPUB    │  │ Origami │  │ EPUB    │   │
│  │ Hegland │  │ Author  │  │ Author  │  │ Author  │   │
│  └─────────┘  └─────────┘  └─────────┘  └─────────┘   │
│                                                         │
│  ◇ = Origami-enhanced indicator                         │
│                                                         │
│  Sort: [Date Added ▾]  Filter: [All ▾] [Origami Only]  │
└─────────────────────────────────────────────────────────┘

9. File Format Detection Summary

On opening an EPUB, the reader classifies it:

CheckResult
Valid EPUB 3 ZIP with mimetype + container.xml + OPFStandard EPUB → full reading features
origami-meta/ directory present in ZIPOrigami Enhanced → activate enhanced UI
origami-meta/citations.json presentEnable citation panel, citation popovers
origami-meta/glossary.json presentEnable glossary highlighting and panel
origami-meta/spatial-layout.json presentEnable Map view
origami-meta/id-map.json presentEnable cross-reference resolution
origami-meta/visual-meta.json presentEnable metadata inspector, self-citation
XHTML contains id="ot-*" attributesEnable deep linking, address display
XHTML contains class="key-sentence"Enable key sentence navigation
XHTML contains class="origami-cite"Enable citation click handling

Each feature activates independently. A document could have citations but no spatial layout, or a glossary but no key sentences. The reader adapts.


10. Development Phases

Phase 1: Core EPUB Reader (4–6 weeks)

Deliverable: a functional macOS EPUB 3 reader that can replace basic use of Apple Books for local EPUB reading.

  • EPUB ZIP parsing and OPF/spine loading
  • WKWebView-based reading view with scroll and paginated modes
  • TOC sidebar from nav.xhtml
  • Font/size/theme preferences
  • Library view with import and basic metadata display
  • In-document search
  • Reading position memory
  • VoiceOver accessibility
  • Sparkle or similar for auto-updates

Phase 2: Origami Detection and Citation Interaction (3–4 weeks)

Deliverable: the reader detects Origami EPUBs and provides citation popovers and the citation panel.

  • Origami detection logic
  • JSON metadata parsing (citations, visual-meta)
  • JavaScript bridge for citation clicks
  • Citation popover UI
  • Citation panel sidebar
  • Copy BibTeX / Copy Citation actions
  • Metadata inspector panel
  • Origami badge in toolbar

Phase 3: Addressable Linking and Key Sentences (2–3 weeks)

Deliverable: deep linking, address display, key sentence navigation, and the origami:// URL scheme.

  • Address bar / status bar showing current ot-NNN
  • Copy Address context menu action
  • origami:// URL scheme registration and handling
  • Key sentence toggle (highlighting)
  • Key sentence navigator panel
  • Copy Key Sentences action

Phase 4: Document-to-Document Linking (3–4 weeks)

Deliverable: clicking a citation can open the source document locally if available.

  • Library index with SQLite backing
  • Citation cross-reference graph (which documents cite which)
  • DOI and title matching for local resolution
  • “Open Source Document” flow with fallback to online search
  • “Cited By” view for any document in the library
  • Cross-library citation search

Phase 5: Map / Spatial View (4–6 weeks)

Deliverable: the 2D Map view showing document structure and citation relationships.

  • Spatial layout JSON parsing
  • 2D canvas rendering (SwiftUI Canvas or AppKit custom view)
  • Node display with type-based colour coding
  • Connection/edge rendering
  • Automatic layout algorithms (hierarchical, force-directed)
  • Click-to-navigate between Map and Reading views
  • Node type filtering
  • Zoom and pan with trackpad

Phase 6: Polish, Performance, and Release (2–3 weeks)

  • Performance profiling with large EPUBs (500+ pages)
  • Memory management for large libraries (1000+ documents)
  • Crash reporting (Sentry or similar)
  • App Store preparation (signing, sandboxing, notarisation)
  • Documentation: user guide, developer guide for the Origami metadata format
  • Open-source repository setup (LICENSE, README, CONTRIBUTING)

Total estimated timeline: ~5–6 months with one full-time developer, or ~3–4 months with two developers working in parallel (one on rendering/UI, one on document engine/library).


11. Technology Choices

ComponentRecommended TechnologyRationale
UI frameworkSwiftUIModern, declarative, future-proof for visionOS port
Content renderingWKWebViewHandles EPUB XHTML/CSS natively, accessible
Local databaseSQLite via GRDB.swiftLightweight, FTS5 for search, no server needed
ZIP handlingZIPFoundation (Swift)Mature, handles the mimetype-first constraint
JavaScript bridgeWKScriptMessageHandlerBuilt into WebKit, bidirectional
Map viewSwiftUI CanvasGPU-accelerated 2D drawing, gesture support
JSON parsingSwift CodableNative, type-safe
Plist parsingPropertyListSerializationNative Foundation, needed only if importing .liquid directly
Auto-updatesSparkleStandard for macOS non-App Store distribution
TestingXCTest + EPUBCheckUnit tests + EPUB validation

12. Accessibility Requirements

The reader itself must be fully accessible, not just the documents it displays:

  • All toolbar buttons, sidebar items, and panels must have accessibility labels
  • The Map view must provide a text-based alternative (a list of nodes and connections) accessible via VoiceOver
  • Keyboard navigation must reach every interactive element
  • The citation popover must be keyboard-dismissible and screen-reader-announced
  • Respect the user’s Dynamic Type / text size preferences for the application chrome (sidebars, panels)
  • Support Reduce Motion preferences (disable smooth-scroll animations when enabled)

13. Future Considerations (Not in Scope for v1.0)

visionOS port: The architecture is designed with this in mind. SwiftUI views port to visionOS with relatively little modification. The Map view’s 3D data (z coordinates) would be used in an immersive space. WKWebView is not available on visionOS — the reading view would need to use a RealityKit-based text rendering approach or a SwiftUI text layout. This is a substantial engineering effort and should be a separate project phase.

Annotation and highlighting: Users will want to highlight text and add notes. This is a natural v1.1 feature. Store annotations locally (not in the EPUB) keyed by document ID + anchor ID. The addressing system makes this trivial — annotations attach to ot-NNN anchors and survive re-export.

Export and sharing: “Share reading position” — generate an origami:// URL that another user with the same document could use. “Export annotations” — generate a JSON or markdown file of all highlights and notes, with anchored references.

Collaboration: Multiple users could share annotation layers via a sync service. Out of scope for v1.0 but the architecture (annotations stored separately from documents, keyed by immutable anchors) supports it.

LLM integration: The reader could offer a “Summarise” or “Explain” action that sends the document’s clean XHTML (or just the key sentences) to a local or cloud LLM. The Origami metadata makes this dramatically more effective than sending raw PDF text. A natural v1.x feature.


14. Open Source and Licensing

The reader should be released under the MIT License, consistent with the Origami Text project’s open invitation to the community. The repository should include:

  • Full source code
  • Build instructions
  • Sample Origami EPUB files for testing
  • The Origami metadata JSON schema definitions
  • A CONTRIBUTING guide encouraging reader developers to support the format

The goal is not just to ship a reader, but to provide a reference implementation that any developer can study to add Origami support to their own tools.