PDF export options: root place, depth, tree/by-place layout, theme grouping, table of contents #41

Closed
opened 2026-11-02 11:41:27 +00:00 by Gilles · 0 comments
Owner

Exporting a PDF (validated version, current state, or a spec extract) currently always renders the whole tree, nested, with no table of contents.

Add export options to PdfExportJob, applied to every target alike:

  • Root place (root_place): export only that place's subtree (not combinable with spec, whose own place is already the root).
  • Max depth (max_depth): relative to the root place, 0 = that place only, null = unlimited.
  • Layout (layout): tree (current, nested) or by_place (one flat section per place with its full path, a link to its parent place and to each child place).
  • Group by theme (group_by_theme): one chapter per theme (then an untagged chapter), each laid out with the chosen layout.
  • Table of contents: always generated, with page numbers, internal links and PDF bookmarks.

In both layouts each spec links to the spec it refines and to its refinements; a target cut from the document renders as plain text.

The render context keeps its existing root tree untouched so custom templates keep working, and gains export, places, themes and toc. The template preview endpoint accepts the same layout/group_by_theme options.

Spec: THI-168
Spec: THI-178
Spec: THI-188
Spec: THI-198

Exporting a PDF (validated version, current state, or a spec extract) currently always renders the whole tree, nested, with no table of contents. Add export options to `PdfExportJob`, applied to every target alike: - **Root place** (`root_place`): export only that place's subtree (not combinable with `spec`, whose own place is already the root). - **Max depth** (`max_depth`): relative to the root place, 0 = that place only, null = unlimited. - **Layout** (`layout`): `tree` (current, nested) or `by_place` (one flat section per place with its full path, a link to its parent place and to each child place). - **Group by theme** (`group_by_theme`): one chapter per theme (then an untagged chapter), each laid out with the chosen layout. - **Table of contents**: always generated, with page numbers, internal links and PDF bookmarks. In both layouts each spec links to the spec it refines and to its refinements; a target cut from the document renders as plain text. The render context keeps its existing `root` tree untouched so custom templates keep working, and gains `export`, `places`, `themes` and `toc`. The template preview endpoint accepts the same `layout`/`group_by_theme` options. Spec: THI-168 Spec: THI-178 Spec: THI-188 Spec: THI-198
Sign in to join this conversation.
No description provided.