feature: PDF export options (root place, depth, layout, theme grouping, table of contents) #42
No reviewers
Labels
No labels
breaking
bug
ci
dependencies
documentation
feature
security
skip-changelog
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
thierryade/backend!42
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/pdf-export-options"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #41
What
Export options on
PdfExportJob, for every target (validated version, current state, spec extract):root_placespec)max_depthlayouttree/by_placetreegroup_by_themefalseThe default template now always starts with a table of contents (page numbers via
target-counter, internal links, PDF bookmarks), and renders both layouts with or without theme chapters. Inby_place, each place section shows its full path and links to its parent and child places; in both layouts each spec links to the spec it refines and to its refinements. Targets cut from the document (by root place, depth, or another theme chapter) render as plain text.How
apps/exports/context.pyassembles the context from plain place/spec/theme rows;snapshot.pynow only reads rows (frozen snapshot or live state), andfixtures.pybuilds the preview context with the same function, so the three can't drift apart.root(ungrouped tree) is unchanged for existing custom templates; new keys areexport,places,themes,toc, and per nodeanchor/depth/path/parent/child_places, per specanchor/refines/refined_by.POST /api/pdf-templates/preview/acceptslayout/group_by_theme.-<place-slug>/-p<depth>suffix when those options are set.0004_pdfexportjob_export_options.Tests
234 passed (23 new: context assembly on the fixture rows, snapshot context options, API validation/defaults/filenames, and a real WeasyPrint render of all 4 layout x grouping combinations checking internal links and bookmarks). pylint 10/10, autopep8 clean, bandit clean. Also checked the rendered PDFs visually (TOC with page numbers, by-place sections with links).
Frontend dialog follows in thierryade/frontend.
🤖 Generated with Claude Code
https://claude.ai/code/session_01CrK5Cbdm97HrbhC9wPMLyu
📊 Rapports Argus pour cette PR