From 7c3c5dc63198489a2309e2fe0fd66cd79bbfc8f1 Mon Sep 17 00:00:00 2001 From: John Wooten Date: Wed, 9 Sep 2026 16:33:55 -0400 Subject: [PATCH 1/8] =?UTF-8?q?=F0=9F=8E=A8=20Refine=20blockquotes=20with?= =?UTF-8?q?=20link-colored=20accents?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Codex --- pdf_compiler.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/pdf_compiler.py b/pdf_compiler.py index 9d4b89f..b8964f0 100644 --- a/pdf_compiler.py +++ b/pdf_compiler.py @@ -53,6 +53,17 @@ def __init__( self.outline = outline super().__init__(text, style, bulletText=bulletText, **kwargs) + def draw(self): + accent = getattr(self.style, "quoteAccent", None) + if accent is not None: + self.canv.saveState() + self.canv.setStrokeColor(accent) + self.canv.setLineWidth(2) + x = self.style.leftIndent - 10 + self.canv.line(x, 0, x, self.height) + self.canv.restoreState() + super().draw() + class TrackingDoc(SimpleDocTemplate): def __init__(self, *args, **kwargs): @@ -353,13 +364,11 @@ def _styles(self): ParagraphStyle( "QuoteX", parent=styles["BodyX"], - leftIndent=0.28 * inch, + leftIndent=0.25 * inch, rightIndent=0.18 * inch, - borderColor=colors.HexColor("#AAB2BD"), - borderWidth=0.6, - borderPadding=6, - spaceBefore=5, - spaceAfter=7, + quoteAccent=colors.HexColor(self.link_color), + spaceBefore=10, + spaceAfter=12, ) ) styles.add( From 4f7a580a4727db16f6366e2ccf1395ad79536bf0 Mon Sep 17 00:00:00 2001 From: John Wooten Date: Wed, 9 Sep 2026 16:43:16 -0400 Subject: [PATCH 2/8] =?UTF-8?q?=F0=9F=8E=A8=20Adjust=20blockquote=20stylin?= =?UTF-8?q?g=20for=20better=20visual=20impact?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pdf_compiler.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/pdf_compiler.py b/pdf_compiler.py index b8964f0..4838fe9 100644 --- a/pdf_compiler.py +++ b/pdf_compiler.py @@ -57,10 +57,21 @@ def draw(self): accent = getattr(self.style, "quoteAccent", None) if accent is not None: self.canv.saveState() + x = self.style.leftIndent - 10 + padding = 6 + tint = colors.Color( + 1 - (1 - accent.red) * 0.05, + 1 - (1 - accent.green) * 0.05, + 1 - (1 - accent.blue) * 0.05, + ) + self.canv.setFillColor(tint) + self.canv.rect( + x, -padding, self.width - self.style.rightIndent - x, + self.height + 2 * padding, stroke=0, fill=1, + ) self.canv.setStrokeColor(accent) self.canv.setLineWidth(2) - x = self.style.leftIndent - 10 - self.canv.line(x, 0, x, self.height) + self.canv.line(x, -padding, x, self.height + padding) self.canv.restoreState() super().draw() @@ -367,8 +378,8 @@ def _styles(self): leftIndent=0.25 * inch, rightIndent=0.18 * inch, quoteAccent=colors.HexColor(self.link_color), - spaceBefore=10, - spaceAfter=12, + spaceBefore=18, + spaceAfter=20, ) ) styles.add( From 3e1e480df9713032b21b89c6fa957233330e81be Mon Sep 17 00:00:00 2001 From: John Wooten Date: Wed, 9 Sep 2026 16:49:28 -0400 Subject: [PATCH 3/8] =?UTF-8?q?=F0=9F=8E=A8=20Adjust=20blockquote=20stylin?= =?UTF-8?q?g=20for=20better=20visual=20impact?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pdf_compiler.py | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/pdf_compiler.py b/pdf_compiler.py index 4838fe9..fac64e0 100644 --- a/pdf_compiler.py +++ b/pdf_compiler.py @@ -60,15 +60,26 @@ def draw(self): x = self.style.leftIndent - 10 padding = 6 tint = colors.Color( - 1 - (1 - accent.red) * 0.05, - 1 - (1 - accent.green) * 0.05, - 1 - (1 - accent.blue) * 0.05, + 1 - (1 - accent.red) * 0.20, + 1 - (1 - accent.green) * 0.20, + 1 - (1 - accent.blue) * 0.20, ) self.canv.setFillColor(tint) - self.canv.rect( - x, -padding, self.width - self.style.rightIndent - x, - self.height + 2 * padding, stroke=0, fill=1, - ) + right = self.width - self.style.rightIndent + 8 + bottom, top = -padding, self.height + padding + radius = min(8, (top - bottom) / 2, (right - x) / 2) + curve = radius * 0.5522847498 + background = self.canv.beginPath() + background.moveTo(x, bottom) + background.lineTo(right - radius, bottom) + background.curveTo(right - radius + curve, bottom, + right, bottom + radius - curve, right, bottom + radius) + background.lineTo(right, top - radius) + background.curveTo(right, top - radius + curve, + right - radius + curve, top, right - radius, top) + background.lineTo(x, top) + background.close() + self.canv.drawPath(background, stroke=0, fill=1) self.canv.setStrokeColor(accent) self.canv.setLineWidth(2) self.canv.line(x, -padding, x, self.height + padding) @@ -376,7 +387,7 @@ def _styles(self): "QuoteX", parent=styles["BodyX"], leftIndent=0.25 * inch, - rightIndent=0.18 * inch, + rightIndent=0.18 * inch + 8, quoteAccent=colors.HexColor(self.link_color), spaceBefore=18, spaceAfter=20, From 7471ec19977953d9a3589b2b0934ba7219a48f2f Mon Sep 17 00:00:00 2001 From: John Wooten Date: Wed, 9 Sep 2026 16:49:32 -0400 Subject: [PATCH 4/8] =?UTF-8?q?=F0=9F=8E=A8=20Adjust=20blockquote=20stylin?= =?UTF-8?q?g=20and=20add=20corner=20radius=20input?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 1 + pdf_compiler.py | 6 ++++-- templates/index.html | 4 ++++ typography_renderer.py | 5 +++++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 0ba030f..c175589 100644 --- a/app.py +++ b/app.py @@ -160,6 +160,7 @@ def render_pdf(): typography = TypographySettings( body_font_size=form_float("body_font_size", 12.0), line_spacing=form_float("line_spacing", 1.3), + blockquote_corner_radius=form_float("blockquote_corner_radius", 8.0), h1_font_size=form_float("h1_font_size", 16.5), h2_font_size=form_float("h2_font_size", 13.7), h3_font_size=form_float("h3_font_size", 12.2), diff --git a/pdf_compiler.py b/pdf_compiler.py index fac64e0..97c9719 100644 --- a/pdf_compiler.py +++ b/pdf_compiler.py @@ -65,9 +65,10 @@ def draw(self): 1 - (1 - accent.blue) * 0.20, ) self.canv.setFillColor(tint) - right = self.width - self.style.rightIndent + 8 + corner_radius = self.style.quoteCornerRadius + right = self.width - self.style.rightIndent + corner_radius bottom, top = -padding, self.height + padding - radius = min(8, (top - bottom) / 2, (right - x) / 2) + radius = min(corner_radius, (top - bottom) / 2, (right - x) / 2) curve = radius * 0.5522847498 background = self.canv.beginPath() background.moveTo(x, bottom) @@ -389,6 +390,7 @@ def _styles(self): leftIndent=0.25 * inch, rightIndent=0.18 * inch + 8, quoteAccent=colors.HexColor(self.link_color), + quoteCornerRadius=8, spaceBefore=18, spaceAfter=20, ) diff --git a/templates/index.html b/templates/index.html index c506485..24c8bb4 100644 --- a/templates/index.html +++ b/templates/index.html @@ -470,6 +470,10 @@

PDF Compiler

Style
+