Projects BibleWeb Notes Note export (JSON/Markdown)
Done

Note export (JSON/Markdown)

Area: Notes Milestone: v1

Context

Problem: Users invest time writing Bible study notes. They want to back up their notes or use them in other tools — documents, study groups, blog posts.

Solution: Export all notes as either JSON (structured, for data processing) or Markdown (formatted, for reading and sharing). Triggered from the notes list page.

Not included: Import from external formats, or selective export (individual notes). This exports all notes at once.

Functional

User flow:

  1. User goes to /notes
  2. Clicks the Export button (Premium tier required)
  3. Chooses format: JSON or Markdown
  4. Browser downloads the file

JSON format:

[{ "reference": "Genesis 1:1", "type": "verse", "content": "...", "createdAt": "...", "updatedAt": "..." }]

Markdown format:

# My Bible Notes

Genesis 1:1

Note content here...

verse — March 22, 2026



**Edge cases:**
- Empty notes list → downloads a file with empty array (JSON) or just the header (Markdown)
- Very large exports (hundreds of notes) → handled synchronously, no streaming needed

UX & Design

Export button: On the notes list page, gated behind Premium tier badge.

Technical

Export functions (apps/web/src/lib/utils/export.ts):

  • exportNotesAsJson(notes, lang) — maps to structured objects, JSON.stringify(data, null, 2)
  • exportNotesAsMarkdown(notes, lang) — builds heading + per-note sections with reference, content, date, dividers
  • downloadFile(content, filename, mimeType) — creates Blob URL, triggers click download

Tier: Premium only (noteExport: true in tier definitions). Free has max 5 notes, Pro has unlimited + cross-linking but no export.

Files:

  • apps/web/src/lib/utils/export.ts — export functions + download utility
  • apps/web/src/routes/(app)/notes/+page.svelte — export button UI
  • apps/web/src/lib/tier.ts — tier feature definitions

Status

Current: DONE Milestone: v1 Priority: Medium — Premium value feature

Dependencies:

  • Requires: notes system (DONE), tier system (DONE)