From e74bc04cb3c6b51da0296515d2b3121724a3b343 Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 14 Jun 2026 20:57:32 +0000 Subject: [PATCH] Show timestamp and speaker name on same line as text in transcript .docx --- scraibe/email_sender.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/scraibe/email_sender.py b/scraibe/email_sender.py index da1d244..e392f87 100644 --- a/scraibe/email_sender.py +++ b/scraibe/email_sender.py @@ -328,19 +328,21 @@ def create_transcript_docx(text: str, filename: str): m = re.match(r"\[(\d+:\d+(?::\d+)?)\]\s*(.+?):\s*(.*)", line) if m: ts, speaker, content = m.groups() - # Speaker line: bold, underlined, indented - p_spk = doc.add_paragraph() - p_spk.paragraph_format.left_indent = Inches(0.25) - run_spk = p_spk.add_run(f"[{ts}] {speaker.upper()}") - run_spk.bold = True - run_spk.underline = True - run_spk.font.name = "Courier" - run_spk.font.size = Pt(12) + # Single paragraph: [timestamp] SPEAKER NAME underlined, then text inline + p = doc.add_paragraph() + p.paragraph_format.left_indent = Inches(0.25) - # Spoken text line: further indented - p_txt = doc.add_paragraph() - p_txt.paragraph_format.left_indent = Inches(0.5) - run_txt = p_txt.add_run(content.strip()) + # Timestamp + speaker name (underline only, not bold) + run_label = p.add_run(f"[{ts}] {speaker.upper()}: ") + run_label.bold = False + run_label.underline = True + run_label.font.name = "Courier" + run_label.font.size = Pt(12) + + # Spoken text (no underline, no bold) + run_txt = p.add_run(content.strip()) + run_txt.bold = False + run_txt.underline = False run_txt.font.name = "Courier" run_txt.font.size = Pt(12) else: