0003: Designed HTML resume export, printed to PDF by WeasyPrint¶
- Date: 2026-11-09
- Status: accepted
Problem¶
Kairos tailors the base resume to each job and exports it. The export runs Markdown through pandoc into LaTeX's default article class. The result is a generic document: there is no header block, dates are not right-aligned, there is no accent, and it does not fit one page. The owner already has a resume design they want: one A4 page, an accent rule, right-aligned dates, chips for each project's stack, and track subheadings. It is HTML and CSS printed by Chrome. A tailored resume could not use that design.
Options¶
- A LaTeX template for pandoc. This keeps the pipeline, but the design is CSS, and porting it into LaTeX creates a second copy of every style value.
- HTML from the resolved sections with the design's CSS, printed by headless Chromium. Output matches the owner's PDFs exactly, but it adds about 300 MB of browser to the image.
- The same HTML and CSS, printed by WeasyPrint. It is a Python library on pango, about
20 MB with its libraries. It supports
@page, flexbox, grid and::marker, which is everything the design uses.
Choice¶
Option 3. kairos.render.html_renderer builds the page from the resolved sections. The
style lives in one file, kairos/render/themes/default.css, vendored from the owner's
design. RenderFormat gains html. pdf now means the designed page printed by
WeasyPrint, and tex stays the pandoc path for anyone who wants LaTeX.
The Markdown needs no new syntax beyond what a plain resume has. The renderer reads a few conventions, and each one degrades to ordinary text anywhere else:
| Markdown | Rendered as |
|---|---|
**Headline** line in the preamble |
role line under the name |
| other preamble lines | contact block (links kept) |
### Title — Org, Place (dates) |
entry header; dates and place right-aligned |
plain line under a ### |
context line |
Stack: a, b, c |
chips |
a line containing → |
pipeline line |
#### Track |
track subheading |
Label: values in a skills or technologies section |
two-column skills list |
A tailored section is still Markdown, so tailoring keeps these lines as they are. Only English is rendered for now. The theme's font stack falls back to Inter and Noto Sans, which the image installs, and to WenQuanYi Micro Hei (about 5 MB) for the Chinese terms that tailoring copies from a Chinese job description.