krz/orgstar

A native macOS editor for org-mode files. editor org-mode swift

docs/plans/2026-10-05-export.md

322a87d47526d505d903e05d14e65a5464e1468f
orgstar/docs/plans/2026-10-05-export.md rendered · source · history · blame · raw

23 lines · 1963 bytes

Export Implementation Plan

For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (- [ ]) syntax for tracking.

Goal: Native HTML and Markdown export from OrgCore's tree, and every other format through Emacs.

Architecture: OrgCore/Export/HTMLExport.swift renders the tree in the shape orgo gives, since the org-conformance corpus (orgo's output, checked against ox-html) is the reference the design names: * is <h2> with a CUSTOM_ID or slug id, TODO/priority/tag spans, <strong>/<em>/<code>, timestamps as <time> with ranges joined by –, footnotes numbered by first reference and listed in a closing <section>, captioned or ATTR_HTML images as <figure>, lists split where bullets change between ordered and unordered, quote/center/special block contents rendered as org, export blocks for html only. page wraps the body with the title, author and date and a small stylesheet. MarkdownExport.swift writes GitHub-flavored Markdown. Both follow :exports for src blocks and their results and run nothing. The app writes file.html/file.md beside the file as Emacs's dispatcher does (C-c C-e h h, h o, m m, File ▸ Export); PDF, LaTeX, ODT and plain text run emacs --batch on the buffer's text with org-export-use-babel off.

Tech Stack: Swift 6.2 tools, Swift Testing.

Spec: docs/design.md, "Phase 5", "Testing" (conformance).

Global Constraints

  • The 12 in-scope org-conformance cases (vendored in Tests/OrgCoreTests/Conformance) match their skeletons.
  • Markdown is GitHub-flavored, not ox-md (which leaves tables as HTML and code as indented blocks).

  • HTML body, page, skeleton reduction, conformance; :exports.
  • Markdown.
  • App: export commands, menu, keys; EmacsRunner.export; corpus smoke test.
  • Commit "Export".