Skip to content

feat(export): ship bundled stylesheet themes - #164

Merged
gnacho merged 5 commits into
masterfrom
feat/163-style-themes
Oct 27, 2026
Merged

gnacho merged 5 commits into
masterfrom
feat/163-style-themes

Conversation

@gnacho

@gnacho gnacho commented Oct 27, 2026

Copy link
Copy Markdown
Owner

What this does

Adds four bundled export themes on top of the page templates from #153/#156.

  • data/themes/*.css (sepia, high contrast, technical, academic), compiled into the binary with include_str!, so a Flatpak or AppImage install ships them without installing anything.
  • ExportTheme in settings plus the export-theme GSettings key (default none).
  • Layer order when exporting: template, then theme, then the user stylesheet. The user file still wins, so it can correct a single detail of a theme.
  • The CSS subset grows to keep the themes coherent: --muted-color, border-color on blockquote, th and hr.
  • Preferences > Export is split into two groups: PDF (layout) and Typography and colour (PDF theme and stylesheet). The theme row no longer offers "Custom file…": that entry lived inside the combo and got stuck when the file chooser was cancelled. Loading a stylesheet has its own row with its own buttons.
  • The themes are deliberately different from each other: serif with wide leading (sepia), bigger sans with blue links (high contrast), all-monospaced and tight (technical), eleven point serif with double leading and small headings (academic).

Verification

  • make check green under xvfb: 188 binary tests, all integration suites.
  • New tests: the parser additions (muted colour, table header, rules, quote bar), the theme module (every bundled sheet has an effect, sets type and colour, leaves margins alone, all four differ), and the export layering (theme over template, user stylesheet over theme, every theme against every template).
  • Real PDFs rasterised for the four themes: same document, different fonts, sizes and page counts; with no theme the output is byte-identical to the previous release.

Closes #163

@gnacho
gnacho merged commit 95362bb into master Oct 27, 2026
3 checks passed
@gnacho
gnacho deleted the feat/163-style-themes branch October 27, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PDF export: bundled stylesheet themes

1 participant