jelovirt / pdf-generator

DITA-OT PDF plug-in generator
https://dita-generator.elovirta.com/
Apache License 2.0
12 stars 5 forks source link

PDF `--theme`: Support Part/Chapter styling in bookmaps #70

Open infotexture opened 2 years ago

infotexture commented 2 years ago

Currently, when publishing PDF with the --theme option, bookmap Part and Chapter references are styled with h1 like first-level topic titles.

Many authors who publish PDF choose bookmap for the Part and Chapter constructs, so a PDF theme should at least provide basic styling support for these elements.

If labels, numbers, and titles are rendered on separate lines (like in PDF2), it would be convenient to them independently:

style:
  part:
    label:
      color: $brand-color-secondary
      font-size: 18pt
    number:
      color: $brand-color-primary
      font-size: 36pt
    title:
      border-after: solid 2pt $brand-color-inverse
      color: $brand-color-primary
      font-size: 18pt

If this plug-in renders all 3 on one line instead, the title content could be defined with a dedicated key like in https://github.com/jelovirt/pdf-generator/pull/68, and styled separately from first-level topic titles:

style:
  chapter:
    title:
      color: $brand-color-primary
      content: "Chapter {number}: {title}"
      font-size: 18pt