Fix DOCX generation bug (Step 4) and re-apply cover page layout changes
Mirror and run GitLab CI / build (push) Has been cancelled
Ruff / ruff (push) Has been cancelled

This commit is contained in:
admin
2026-06-21 13:59:05 +00:00
parent f3392d80c6
commit c8ef9cc00d
2 changed files with 8 additions and 23 deletions
+7 -11
View File
@@ -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)