Say for every template whether it is fluid or restricted to a paper format, and hold it to that #9

Open
opened 2026-10-01 07:02:07 +00:00 by tiagoagueda · 0 comments
Owner

The list says: "A template can either be 'fluid' and prints great in all common formats and orientations, or restricted, for example, export only to portrait A4 paper size."

What the core does today

  • Every page is A4. PAGE_FORMAT = "A4" is a constant in the core's src/postulo/documents/pdf.py, every built-in theme says @page { size: A4 }, and the DOCX export is A4 too.
  • The two renderers differ. WeasyPrint honours whatever @page a template writes. Chromium is called with the A4 constant and no orientation, so there a template's own page size is ignored (read from the code and the renderer's documented default; not tried).
  • Nobody can choose the paper: there is no setting per export, per person or per instance.
  • A theme cannot say what it supports: Theme has a name, a label, its templates and its provider.

So a template can only be A4 portrait in practice. The rest waits for postulo/postulo#344.

What the plugin should do

  • Every template declares what it is: fluid, or restricted to the formats it names.
  • A fluid template uses relative measures and no fixed widths, and is tested on every common format in both orientations: nothing overflows, no heading is left alone at the foot of a page, no table loses a column.
  • A restricted template is offered only for its formats; the README says which, and why (a form with fixed boxes, a layout drawn for one sheet).
  • The render test of #1 draws each template on each format it declares.

Decisions

  • Which formats are "common". Recommended: A4 and US Letter, portrait and landscape. A5 and Legal later if asked for.
  • Which templates are fluid. Recommended: lists (#5) and calendars (#6) fluid, since they are the ones printed wide; CVs and letters fluid between A4 and Letter in portrait; a form for an employment service (#4) restricted to the sheet it was drawn for.
  • Before the core change. Recommended: every template ships as A4 portrait and declares it in its README, and the declaration becomes real when postulo/postulo#344 lands.

Needs from the core

postulo/postulo#344: a choice of paper, a way for a theme to declare what it supports, and both renderers honouring it.

Done when

  • Each template's README line and its declaration say fluid or name its formats.
  • A fluid template passes the render test on A4 and US Letter in both orientations.
  • A restricted template is not offered for a format it does not support.

From the list of template improvements of 2026-09-30.

The list says: "A template can either be 'fluid' and prints great in all common formats and orientations, or restricted, for example, export only to portrait A4 paper size." ## What the core does today - **Every page is A4.** `PAGE_FORMAT = "A4"` is a constant in the core's `src/postulo/documents/pdf.py`, every built-in theme says `@page { size: A4 }`, and the DOCX export is A4 too. - **The two renderers differ.** WeasyPrint honours whatever `@page` a template writes. Chromium is called with the A4 constant and no orientation, so there a template's own page size is ignored (read from the code and the renderer's documented default; not tried). - **Nobody can choose the paper**: there is no setting per export, per person or per instance. - **A theme cannot say what it supports**: `Theme` has a name, a label, its templates and its provider. So a template can only be A4 portrait in practice. The rest waits for postulo/postulo#344. ## What the plugin should do - **Every template declares what it is**: fluid, or restricted to the formats it names. - **A fluid template** uses relative measures and no fixed widths, and is tested on every common format in both orientations: nothing overflows, no heading is left alone at the foot of a page, no table loses a column. - **A restricted template** is offered only for its formats; the README says which, and why (a form with fixed boxes, a layout drawn for one sheet). - The render test of #1 draws each template on each format it declares. ## Decisions - **Which formats are "common".** Recommended: A4 and US Letter, portrait and landscape. A5 and Legal later if asked for. - **Which templates are fluid.** Recommended: lists (#5) and calendars (#6) fluid, since they are the ones printed wide; CVs and letters fluid between A4 and Letter in portrait; a form for an employment service (#4) restricted to the sheet it was drawn for. - **Before the core change.** Recommended: every template ships as A4 portrait and declares it in its README, and the declaration becomes real when postulo/postulo#344 lands. ## Needs from the core postulo/postulo#344: a choice of paper, a way for a theme to declare what it supports, and both renderers honouring it. ## Done when - Each template's README line and its declaration say fluid or name its formats. - A fluid template passes the render test on A4 and US Letter in both orientations. - A restricted template is not offered for a format it does not support. From the list of template improvements of 2026-09-30.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Postulo/postulo-templates#9
No description provided.