From 89fa657df87213c540b6f903c38673e3c230d3f8 Mon Sep 17 00:00:00 2001 From: diaco Date: Mon, 20 Jul 2026 14:31:11 +0330 Subject: [PATCH] Show shared title block on HTML and align PDF table chrome. Co-authored-by: Cursor --- README.md | 4 +-- filters/print-chrome.lua | 5 +-- styles/print.css | 32 ++++++++++++------- styles/report.css | 67 +++++++++++++++++++++++++++++++++------- 4 files changed, 81 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 4b28a8f..454a292 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Quarto templates for Kimia Razi Persian (RTL) business reports. One `.qmd` source renders to: -- **HTML** — simple RTL reading layout (no print chrome on screen) +- **HTML** — RTL reading layout with the same title block as PDF (company, logo, report title) - **PDF** — via WeasyPrint from the HTML, matching `typst-templates` page chrome (sidebar, header, title block, tables) ## Requirements @@ -53,5 +53,5 @@ examples/product-test.qmd ## Notes - PDF layout targets `typst-templates` (`product_test_template.typ` / `travel-report-template.typ`): A4, RTL, rotated left sidebar with page `n / N`, running header on page 2+, content-sized tables with grey header row. -- HTML on screen stays a simple reading view; print chrome is `display: none` until print/PDF. +- HTML on screen shows the shared title block (logo + company | subtitle + report title); running header and sidebar stay `display: none` until print/PDF. - Typst is not used for PDF generation. diff --git a/filters/print-chrome.lua b/filters/print-chrome.lua index be9f4b4..0c64519 100644 --- a/filters/print-chrome.lua +++ b/filters/print-chrome.lua @@ -1,5 +1,5 @@ -- Inject typst-templates-style title block + sidebar into HTML for WeasyPrint PDF. --- Screen CSS hides .print-only; print.css shows them. +-- Title block is shared with screen HTML; .print-only (running header, sidebar) is screen-hidden. local function stringify(v) if v == nil then @@ -162,8 +162,9 @@ function Meta(meta) end -- Logo first (left), title text second (right) — matches product_test_template.typ + -- Visible on screen and in PDF (no print-only); Quarto default title is hidden in CSS. local title_block = string.format([[ -