Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

feat(export): add Markdown format for transcript export

Gabriel Steinc49396058eac
diff --git a/src/components/notes/NoteEditor.tsx b/src/components/notes/NoteEditor.tsx
index d04d1e832..158faffeb 100644
--- a/src/components/notes/NoteEditor.tsx
+++ b/src/components/notes/NoteEditor.tsx
@@ -79,7 +79,7 @@ interface NoteEditorProps {
onStartRecording: () => void;
onStopRecording: () => void;
onExportNote?: (format: "md" | "txt") => void;
- onExportTranscript?: (format: "txt" | "srt" | "json") => void;
+ onExportTranscript?: (format: "txt" | "srt" | "json" | "md") => void;
enhancement?: Enhancement;
actionPicker?: React.ReactNode;
actionProcessingState?: ActionProcessingState;
@@ -795,6 +795,13 @@ export default function NoteEditor({
<FileText size={13} className="text-foreground/40" />
{t("notes.editor.asSubtitles")}
</DropdownMenuItem>
+ <DropdownMenuItem
+ onClick={() => onExportTranscript("md")}
+ className="text-xs gap-2"
+ >
+ <FileText size={13} className="text-foreground/40" />
+ {t("notes.editor.asTranscriptMarkdown")}
+ </DropdownMenuItem>
<DropdownMenuItem
onClick={() => onExportTranscript("json")}
className="text-xs gap-2"
diff --git a/src/components/notes/PersonalNotesView.tsx b/src/components/notes/PersonalNotesView.tsx
index 806bd01b2..a35370527 100644
--- a/src/components/notes/PersonalNotesView.tsx
+++ b/src/components/notes/PersonalNotesView.tsx
@@ -459,7 +459,7 @@ export default function PersonalNotesView({
);
const handleExportTranscript = useCallback(
- async (format: "txt" | "srt" | "json") => {
+ async (format: "txt" | "srt" | "json" | "md") => {
if (!activeNoteId) return;
await window.electronAPI.exportTranscript(activeNoteId, format);
},
diff --git a/src/helpers/ipcHandlers.js b/src/helpers/ipcHandlers.js
index 7e9847c45..f2c125cb1 100644
--- a/src/helpers/ipcHandlers.js
+++ b/src/helpers/ipcHandlers.js
@@ -1076,7 +1076,8 @@ class IPCHandlers {
const { dialog } = require("electron");
const fs = require("fs");
- const ext = format === "srt" ? "srt" : format === "json" ? "json" : "txt";
+ const extMap = { srt: "srt", json: "json", md: "md" };
+ const ext = extMap[format] || "txt";
const safeName = (note.title || "Untitled").replace(/[/\\?%*:|"<>]/g, "-");
const result = await dialog.showSaveDialog({
@@ -1085,6 +1086,7 @@ class IPCHandlers {
{ name: "Text", extensions: ["txt"] },
{ name: "SubRip Subtitles", extensions: ["srt"] },
{ name: "JSON", extensions: ["json"] },
+ { name: "Markdown", extensions: ["md"] },
],
});
@@ -1096,6 +1098,8 @@ class IPCHandlers {
exportContent = transcriptFormatter.formatTxt(note, segments, speakerMappings);
} else if (format === "srt") {
exportContent = transcriptFormatter.formatSrt(segments, speakerMappings);
+ } else if (format === "md") {
+ exportContent = transcriptFormatter.formatMd(note, segments, speakerMappings);
} else {
exportContent = transcriptFormatter.formatJson(note, segments, speakerMappings);
}
diff --git a/src/helpers/transcriptFormatter.js b/src/helpers/transcriptFormatter.js
index 95e35e5da..f5649ac5b 100644
--- a/src/helpers/transcriptFormatter.js
+++ b/src/helpers/transcriptFormatter.js
@@ -42,8 +42,7 @@ function formatSrtTimestamp(seconds) {
return `${String(h).padStart(2, "0")}:${String(m).padStart(2, "0")}:${String(sec).padStart(2, "0")},${String(ms).padStart(3, "0")}`;
}
-function formatTxt(note, segments, speakerMappings) {
- const merged = mergeSegments(segments);
+function extractMetadata(note) {
const title = note.title || "Untitled";
const noteDate = new Date(note.created_at);
const dateStr =
@@ -57,6 +56,13 @@ function formatTxt(note, segments, speakerMappings) {
participants = parsed.map((p) => p.name).filter(Boolean);
} catch {}
+ return { title, dateStr, participants };
+}
+
+function formatTxt(note, segments, speakerMappings) {
+ const merged = mergeSegments(segments);
+ const { title, dateStr, participants } = extractMetadata(note);
+
const lines = [title, dateStr];
if (participants.length) lines.push(`Participants: ${participants.join(", ")}`);
lines.push("", "──────────────────────────────────", "");
@@ -84,12 +90,7 @@ function formatSrt(segments, speakerMappings) {
function formatJson(note, segments, speakerMappings) {
const merged = mergeSegments(segments);
- const title = note.title || "Untitled";
- const noteDate = new Date(note.created_at);
- const dateStr =
- noteDate.toLocaleDateString(undefined, { year: "numeric", month: "long", day: "numeric" }) +
- " " +
- noteDate.toLocaleTimeString(undefined, { hour: "2-digit", minute: "2-digit" });
+ const { title, dateStr } = extractMetadata(note);
const speakersSet = new Set();
for (const seg of merged) speakersSet.add(resolveSpeaker(seg, speakerMappings));
@@ -116,4 +117,18 @@ function formatJson(note, segments, speakerMappings) {
);
}
-module.exports = { formatTxt, formatSrt, formatJson };
+function formatMd(note, segments, speakerMappings) {
+ const merged = mergeSegments(segments);
+ const { title, dateStr, participants } = extractMetadata(note);
+
+ const lines = [`# ${title}`, "", `**Date:** ${dateStr}`];
+ if (participants.length) lines.push(`**Participants:** ${participants.join(", ")}`);
+ lines.push("", "---", "");
+ for (const seg of merged) {
+ lines.push(`**${resolveSpeaker(seg, speakerMappings)}** \`${formatTimestamp(seg.timestamp)}\``);
+ lines.push(`${seg.text}`, "");
+ }
+ return lines.join("\n");
+}
+
+module.exports = { formatTxt, formatSrt, formatJson, formatMd };
diff --git a/src/locales/de/translation.json b/src/locales/de/translation.json
index 6a4bf924e..963677a8a 100644
--- a/src/locales/de/translation.json
+++ b/src/locales/de/translation.json
@@ -1679,6 +1679,7 @@
"asTranscriptText": "Als Textdatei (.txt)",
"asSubtitles": "Als Untertitel (.srt)",
"asJson": "Als JSON (.json)",
+ "asTranscriptMarkdown": "Als Markdown (.md)",
"raw": "Roh",
"enhanced": "Verbessert",
"saving": "Wird gespeichert",
diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json
index 0dbd6e9e3..e0fe6240a 100644
--- a/src/locales/en/translation.json
+++ b/src/locales/en/translation.json
@@ -1836,6 +1836,7 @@
"asTranscriptText": "As Plain Text (.txt)",
"asSubtitles": "As Subtitles (.srt)",
"asJson": "As JSON (.json)",
+ "asTranscriptMarkdown": "As Markdown (.md)",
"raw": "Raw",
"enhanced": "Enhanced",
"saving": "Saving",
diff --git a/src/locales/es/translation.json b/src/locales/es/translation.json
index 5e9e0b962..7744d1c18 100644
--- a/src/locales/es/translation.json
+++ b/src/locales/es/translation.json
@@ -1727,6 +1727,7 @@
"asTranscriptText": "Como texto plano (.txt)",
"asSubtitles": "Como subtítulos (.srt)",
"asJson": "Como JSON (.json)",
+ "asTranscriptMarkdown": "Como Markdown (.md)",
"raw": "Sin procesar",
"enhanced": "Mejorado",
"saving": "Guardando",
diff --git a/src/locales/fr/translation.json b/src/locales/fr/translation.json
index 6bee5edcf..88f333d1c 100644
--- a/src/locales/fr/translation.json
+++ b/src/locales/fr/translation.json
@@ -1788,6 +1788,7 @@
"asTranscriptText": "En texte brut (.txt)",
"asSubtitles": "En sous-titres (.srt)",
"asJson": "En JSON (.json)",
+ "asTranscriptMarkdown": "En Markdown (.md)",
"raw": "Brut",
"enhanced": "Amélioré",
"saving": "Enregistrement",
diff --git a/src/locales/it/translation.json b/src/locales/it/translation.json
index cdc5f89d8..6cf5ba412 100644
--- a/src/locales/it/translation.json
+++ b/src/locales/it/translation.json
@@ -1679,6 +1679,7 @@
"asTranscriptText": "Come testo semplice (.txt)",
"asSubtitles": "Come sottotitoli (.srt)",
"asJson": "Come JSON (.json)",
+ "asTranscriptMarkdown": "Come Markdown (.md)",
"raw": "Originale",
"enhanced": "Migliorato",
"saving": "Salvataggio",
diff --git a/src/locales/ja/translation.json b/src/locales/ja/translation.json
index abbde75db..0237d1826 100644
--- a/src/locales/ja/translation.json
+++ b/src/locales/ja/translation.json
@@ -1597,6 +1597,7 @@
"asTranscriptText": "プレーンテキスト (.txt)",
"asSubtitles": "字幕ファイル (.srt)",
"asJson": "JSON (.json)",
+ "asTranscriptMarkdown": "Markdown (.md)",
"raw": "元のテキスト",
"enhanced": "強化済み",
"saving": "保存中",
diff --git a/src/locales/pt/translation.json b/src/locales/pt/translation.json
index 9235516c9..dd45e1fe5 100644
--- a/src/locales/pt/translation.json
+++ b/src/locales/pt/translation.json
@@ -1679,6 +1679,7 @@
"asTranscriptText": "Como texto simples (.txt)",
"asSubtitles": "Como legendas (.srt)",
"asJson": "Como JSON (.json)",
+ "asTranscriptMarkdown": "Como Markdown (.md)",
"raw": "Original",
"enhanced": "Aprimorado",
"saving": "Salvando",
diff --git a/src/locales/ru/translation.json b/src/locales/ru/translation.json
index b48674181..1cdfe1350 100644
--- a/src/locales/ru/translation.json
+++ b/src/locales/ru/translation.json
@@ -1679,6 +1679,7 @@
"asTranscriptText": "Как текстовый файл (.txt)",
"asSubtitles": "Как субтитры (.srt)",
"asJson": "Как JSON (.json)",
+ "asTranscriptMarkdown": "Как Markdown (.md)",
"raw": "Исходный",
"enhanced": "Улучшенный",
"saving": "Сохранение",
diff --git a/src/locales/zh-CN/translation.json b/src/locales/zh-CN/translation.json
index cbd49313a..e801b7c39 100644
--- a/src/locales/zh-CN/translation.json
+++ b/src/locales/zh-CN/translation.json
@@ -1674,6 +1674,7 @@
"asTranscriptText": "导出为纯文本 (.txt)",
"asSubtitles": "导出为字幕 (.srt)",
"asJson": "导出为 JSON (.json)",
+ "asTranscriptMarkdown": "导出为 Markdown (.md)",
"raw": "原始内容",
"enhanced": "增强内容",
"saving": "保存中",
diff --git a/src/locales/zh-TW/translation.json b/src/locales/zh-TW/translation.json
index 101429699..9f9912871 100644
--- a/src/locales/zh-TW/translation.json
+++ b/src/locales/zh-TW/translation.json
@@ -1674,6 +1674,7 @@
"asTranscriptText": "匯出為純文字 (.txt)",
"asSubtitles": "匯出為字幕 (.srt)",
"asJson": "匯出為 JSON (.json)",
+ "asTranscriptMarkdown": "匯出為 Markdown (.md)",
"raw": "原始",
"enhanced": "已增強",
"saving": "儲存中",
diff --git a/src/types/electron.ts b/src/types/electron.ts
index 508cfce30..205b87ee7 100644
--- a/src/types/electron.ts
+++ b/src/types/electron.ts
@@ -467,7 +467,7 @@ declare global {
) => Promise<{ success: boolean; error?: string }>;
exportTranscript: (
noteId: number,
- format: "txt" | "srt" | "json"
+ format: "txt" | "srt" | "json" | "md"
) => Promise<{ success: boolean; error?: string }>;
searchNotes: (query: string, limit?: number) => Promise<NoteItem[]>;
semanticSearchNotes: (query: string, limit?: number) => Promise<NoteItem[]>;