Fix DOCX generation bug (Step 4) and re-apply cover page layout changes
This commit is contained in:
+7
-11
@@ -2,12 +2,11 @@
|
||||
Cover-page generator for transcript and summary DOCX files.
|
||||
|
||||
Layout (all centered):
|
||||
- 5 blank lines
|
||||
- 3 blank lines
|
||||
- Title in uppercase: "TRANSCRIPT" or "SUMMARY"
|
||||
- Next line: date of transcription (e.g. "June 19, 2026")
|
||||
- Next line: "Created by <COVER_PAGE_ORGANIZATION>"
|
||||
- 3 blank lines
|
||||
- Next line: "Transcribed by <COVER_PAGE_ORGANIZATION>"
|
||||
- 2 blank lines
|
||||
- Disclaimer (underlined)
|
||||
- Page break (ensures content starts on page 2)
|
||||
|
||||
@@ -76,9 +75,6 @@ def add_cover_page(
|
||||
if not provided, uses current server time in SERVER_TIMEZONE.
|
||||
"""
|
||||
|
||||
# 5 blank lines
|
||||
_add_blank_lines(doc, 5)
|
||||
|
||||
# 3 blank lines
|
||||
_add_blank_lines(doc, 3)
|
||||
|
||||
@@ -92,13 +88,13 @@ def add_cover_page(
|
||||
date_str = now.strftime("%B %d, %Y")
|
||||
_add_centered_paragraph(doc, text=date_str, font_size=Pt(14))
|
||||
|
||||
# Created by + organization
|
||||
# Transcribed by + organization
|
||||
org = (os.getenv("COVER_PAGE_ORGANIZATION") or "").strip()
|
||||
if org:
|
||||
_add_centered_paragraph(doc, text=f"Created by {org}", font_size=Pt(12))
|
||||
_add_centered_paragraph(doc, text=f"Transcribed by {org}", font_size=Pt(12))
|
||||
|
||||
# 3 blank lines
|
||||
_add_blank_lines(doc, 3)
|
||||
# 2 blank lines
|
||||
_add_blank_lines(doc, 2)
|
||||
|
||||
# Disclaimer: only the word "Disclaimer" is underlined
|
||||
disclaimer_title = "Disclaimer"
|
||||
@@ -107,7 +103,7 @@ def add_cover_page(
|
||||
)
|
||||
|
||||
# Underlined "Disclaimer" line
|
||||
p = _add_centered_paragraph(doc, text=disclaimer_title, font_size=Pt(10), underline=True)
|
||||
_add_centered_paragraph(doc, text=disclaimer_title, font_size=Pt(10), underline=True)
|
||||
|
||||
# Body text (not underlined)
|
||||
_add_centered_paragraph(doc, text=disclaimer_body, font_size=Pt(10), underline=False)
|
||||
|
||||
Reference in New Issue
Block a user