Skip to content

Pretty-print Hyperaudio JSON and drop legacy import path#300

Open
maboa wants to merge 1 commit into
mainfrom
298-pretty-print-json-main
Open

Pretty-print Hyperaudio JSON and drop legacy import path#300
maboa wants to merge 1 commit into
mainfrom
298-pretty-print-json-main

Conversation

@maboa
Copy link
Copy Markdown
Member

@maboa maboa commented May 27, 2026

Summary

Two small follow-ups to #297:

  • Pretty-print the export. downloadJson now calls JSON.stringify(jsonData, null, 2) so exported files are indented and readable instead of one long line.
  • Drop the legacy import path. Removes the legacyJsonToHtml function, the jsonData.article fallback in jsonToHtml, and the jsonData.url back-compat in importJson. Anyone holding an old export can re-export from a recent build.

Closes #298.

Note: the same commit was previously merged into the 296-improved-json-format branch via PR #299 but never reached main because #297 was merged first. This PR brings it to main directly.

Test plan

  • Export a transcript → file opens with indented, readable JSON.
  • Import the same file → transcript renders identically.
  • Attempt to import an old-format export (with article.section.paragraphs[].spans[]) → either fails or imports as empty, no crash.

- JSON.stringify with two-space indentation so exported files are
  readable and diffable instead of a single long line.
- Remove the legacyJsonToHtml function and the
  jsonData.article fallback in jsonToHtml — anyone holding an old
  export can re-export from a recent build.
- Drop the jsonData.url top-level back-compat in importJson; media
  URL is sourced exclusively from sections[0].mediaUrl now.

Closes #298.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pretty-print exported Hyperaudio JSON and drop legacy import path

1 participant