From 39800ad473f5a378fbce32234107977f133ebf8b Mon Sep 17 00:00:00 2001 From: yair Date: Mon, 19 Jan 2026 16:47:18 +0200 Subject: [PATCH] Add transcript.md download option to help menu --- app.js | 28 ++++++++++++++++++++++++++++ config.js | 1 + index.html | 4 ++++ styles.css | 12 ++++++++++++ 4 files changed, 45 insertions(+) diff --git a/app.js b/app.js index 9d2ca97..89b91c7 100644 --- a/app.js +++ b/app.js @@ -32,6 +32,7 @@ const embeddedWaveformOverlayCtx = embeddedWaveformOverlay ? embeddedWaveformOve // Use values from config.js const transcriptPath = CONFIG.transcript_path; const waveformPath = CONFIG.waveform_path; +const markdownPath = CONFIG.markdown_path; const START_OFFSET_SECONDS = CONFIG.start_offset_seconds; const SPEAKER_LABELS = CONFIG.speaker_labels; const palette = CONFIG.palette; @@ -905,6 +906,33 @@ async function init() { }); } + // Download transcript.md handler + const downloadTranscript = document.getElementById("downloadTranscript"); + if (downloadTranscript) { + downloadTranscript.addEventListener("click", async (event) => { + event.preventDefault(); + try { + const response = await fetch(markdownPath); + if (!response.ok) { + throw new Error(`Transcript not found: ${markdownPath}`); + } + const text = await response.text(); + const blob = new Blob([text], { type: "text/markdown" }); + const url = URL.createObjectURL(blob); + const a = document.createElement("a"); + a.href = url; + a.download = "transcript.md"; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + URL.revokeObjectURL(url); + } catch (err) { + console.error("Failed to download transcript:", err.message); + alert("Transcript file not available."); + } + }); + } + // Close panels when clicking outside window.addEventListener("click", (event) => { if (configPanel && !configPanel.contains(event.target) && !configToggle.contains(event.target)) { diff --git a/config.js b/config.js index 8a41651..c6deffa 100644 --- a/config.js +++ b/config.js @@ -93,6 +93,7 @@ const CONFIG = { CONFIG.audio_path = `${CONFIG.input_dir}/${CONFIG.meeting_name}/${CONFIG.meeting_name}${CONFIG.audio_extension}`; CONFIG.transcript_path = `${CONFIG.output_dir}/${CONFIG.output_format}/${CONFIG.meeting_name}/${CONFIG.meeting_name}.json`; CONFIG.waveform_path = `${CONFIG.output_dir}/${CONFIG.output_format}/${CONFIG.meeting_name}/${CONFIG.meeting_name}.waveform.json`; +CONFIG.markdown_path = `${CONFIG.output_dir}/${CONFIG.output_format}/${CONFIG.meeting_name}/transcript.md`; // Export for use in app.js if (typeof module !== 'undefined' && module.exports) { diff --git a/index.html b/index.html index 3cc52aa..8ea9a3e 100644 --- a/index.html +++ b/index.html @@ -24,6 +24,10 @@
Auto-updates on seek
Click bubble → next phrase
+ +
+ 📄 Transcript (.md) +
diff --git a/styles.css b/styles.css index 1325eb0..7b9fe3d 100644 --- a/styles.css +++ b/styles.css @@ -291,6 +291,18 @@ body { margin-right: 2px; } +.download-link { + color: var(--glow); + text-decoration: none; + cursor: pointer; + transition: color 0.2s ease; +} + +.download-link:hover { + color: #fff; + text-decoration: underline; +} + .menu-footer a { color: var(--steel); text-decoration: none;