Skip to content

Commit 68df21b

Browse files
committed
feat: add JSON export support to Theia
- Added JSON format button to ExportConfigModal with 📦 icon - Added 'json' to valid formats list in validateAndMergeConfig - JSON export available for courses (outputs raw CourseData structure) - Enables round-trip workflow: export JSON → upload → continue
1 parent bea5b70 commit 68df21b

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/lib/components/theia/ExportConfigModal.svelte

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,15 @@
238238
>
239239
🌐 HTML
240240
</button>
241+
<button
242+
type="button"
243+
class="format-tab"
244+
class:active={format === "json"}
245+
on:click={() => (format = "json")}
246+
disabled={isExporting}
247+
>
248+
📦 JSON
249+
</button>
241250
<button
242251
type="button"
243252
class="format-tab disabled"

src/lib/services/theiaService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ export function validateAndMergeConfig(config: Partial<ExportConfig>): ExportCon
211211
}
212212

213213
// Validate format
214-
const validFormats: ExportFormat[] = ['markdown', 'html', 'pdf'];
214+
const validFormats: ExportFormat[] = ['markdown', 'html', 'json', 'pdf'];
215215
if (!validFormats.includes(merged.format)) {
216216
throw new Error(`Invalid format: ${merged.format}`);
217217
}

0 commit comments

Comments
 (0)