feat(export): export all motifs as one combined Markdown document (#4) #49

Merged
rbrooks merged 1 commit from feat/v6.1-export-all-motifs-md into main 2026-06-25 23:30:38 +00:00
Owner

Closes #4 (v6.1).

What

A new GET /api/export/motifs.md that returns every motif combined into a single Markdown document, suitable for sharing. Each motif is rendered with the existing per-motif Markdown formatter (motifToMarkdown), joined under a document header (# Motifs + count) with --- separators between them; a friendly placeholder when there are no motifs.

Surfaced in the UI as a motifs.md button in Settings → Export → All motifs, next to the existing motifs.json.

Why this shape

Reuses the proven per-motif renderer rather than introducing a second formatting path, so single-motif and all-motif exports stay consistent. User-scoped like the sibling motifs.json.

Test

New export.test.ts integration test: asserts the combined document contains each motif's section + its entries, the horizontal-rule separator, the right content-type/filename headers, and the singular/empty wording.

Verification (dev server)

  • API tsc + app tsc/vite build clean
  • export.test.ts 2/2 green

Third and final v6.1 issue (with #47 / #3 and #48 / #5). Once all three merge, the v6.1 milestone is complete — and I'll carry on into v6.2.

🤖 Generated with Claude Code

Closes #4 (v6.1). ## What A new **`GET /api/export/motifs.md`** that returns every motif combined into a single Markdown document, suitable for sharing. Each motif is rendered with the **existing** per-motif Markdown formatter (`motifToMarkdown`), joined under a document header (`# Motifs` + count) with `---` separators between them; a friendly placeholder when there are no motifs. Surfaced in the UI as a **`motifs.md`** button in *Settings → Export → All motifs*, next to the existing `motifs.json`. ## Why this shape Reuses the proven per-motif renderer rather than introducing a second formatting path, so single-motif and all-motif exports stay consistent. User-scoped like the sibling `motifs.json`. ## Test New `export.test.ts` integration test: asserts the combined document contains each motif's section + its entries, the horizontal-rule separator, the right content-type/filename headers, and the singular/empty wording. ## Verification (dev server) - API `tsc` + app `tsc`/`vite build` clean ✅ - `export.test.ts` 2/2 green ✅ Third and final v6.1 issue (with #47 / #3 and #48 / #5). Once all three merge, the **v6.1 milestone is complete** — and I'll carry on into v6.2. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(export): export all motifs as one combined Markdown document (#4)
All checks were successful
CI / App — typecheck, test & build (push) Successful in 1m24s
CI / App — typecheck, test & build (pull_request) Successful in 1m25s
CI / API — typecheck & tests (push) Successful in 2m13s
CI / API — typecheck & tests (pull_request) Successful in 2m21s
26313c5e75
Adds GET /api/export/motifs.md — every motif rendered with the existing
per-motif Markdown formatter, joined under a document header with
horizontal-rule separators (friendly placeholder when there are none).
Surfaced as a "motifs.md" button in Settings → Export → All motifs,
alongside the existing motifs.json.

Adds an integration test covering the combined document, the separator,
and the singular/empty wording.

Closes #4

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
rbrooks scheduled this pull request to auto merge when all checks succeed 2026-06-25 23:19:24 +00:00
rbrooks deleted branch feat/v6.1-export-all-motifs-md 2026-06-25 23:30:38 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rbrooks/TeaLeaves!49
No description provided.