Types & Data Models
A Good Example for creating themed templates for dynamically generating the PDF from the structured source input is provided in this Github repository from the official weasyprint organisation, please use it for reference.Some Notable Mentions Include:https://github.com/CourtBouillon/weasyprint-samples/tree/main/reporthttps://github.com/CourtBouillon/weasyprint-samples/tree/main/bookhttps://github.com/CourtBouillon/weasyprint-samples/tree/main/invoice
https://github.com/CourtBouillon/weasyprint-samples/tree/main
SECTION 9 — DOCUMENT TYPES & DATA MODELS
9.1 Document Type Overview
9.2 Compilation Trigger Schedule
Compilation documents aggregate Newsletter data for the following weekly date ranges within each calendar month. Trigger time: configurable by the Editor in their settings for the respective Organisation. Default trigger time: 6:00 PM IST (GMT +5:30). The trigger runs at the end of the day to include documents produced on the trigger date itself.9.3 Magazine Trigger Schedule
Trigger time: configurable by the Editor. Default: 6:00 PM IST (GMT +5:30).9.3A Quarterly Collection Trigger Schedule
Quarterly Collections aggregate 3 months of data per academic year quarter. Trigger is configurable in Editor settings. Default: 1 week after the quarter ends.Note: For a January–December academic year, Q4 trigger fires on January 7 of the next calendar year.
9.3B Bi-Annual Compendium Trigger Schedule
Bi-Annual Compendiums aggregate 6 months of data. Trigger is configurable. Default: 1 week after the bi-annual period ends.Note: For a January–December academic year, Compendium-2 trigger fires on January 7 of the next calendar year.
9.3C Annual Yearbook Trigger Schedule
The Annual Yearbook aggregates the complete 12 months of an academic year. Trigger is configurable. Default: 1 week after the annual period ends.Intentional co-scheduling: For a January–December academic year, Q4 Collection (6:00 PM), Compendium-2 (6:10 PM), and Annual Yearbook (6:20 PM) all trigger on January 7 of the next year, processing independently as separate parallel documents queued one after another with 10-minute intervals between each.
9.3D Category Extraction
Category Extraction is a standalone document type that cherry-picks specific news categories from individual newsletters over any aggregation range (Week, Month, Quarter, Bi-Annual, Annual).- Creator: Editor (manual)
- UI mechanism: Checkbox interface allowing selection of specific news categories (e.g. “SCIENCE & TECHNOLOGY”) across the aggregation range
- Document naming:
extraction-\{CATEGORY-NAME\}-\{AGGREGATION-DOC-NAME\} - Storage: Uses the same folder structure as the aggregation type from which it was extracted
- Kanban visibility: Appears in Kanban board as its own entity
- Billing flag: Configurable boolean flag
count_in_billing(default:false). Generally set tofalsebecause these documents are primarily used for proofreading and cross-checking purposes of an individual category within the overall final aggregated document. - Drive storage: Saved as its own entity in the path used by the source aggregation type
- Use case example: An exclusive “SCIENCE & TECHNOLOGY” category extracted over a monthly aggregation range could be used for cross-checking purposes to verify the integrity of the actual final Magazine document
- Multi-lingual support: Category Extractions support parallel multilingual generation as configured by Teacher or Editor
9.4 Newsletter Raw Data Structure (Markdown Hierarchy)
The Newsletter document follows this strict heading hierarchy when represented as markdown. This hierarchy governs both the canvas editor display and the PDF template rendering:9.5 Compilation & Magazine Raw Data Structure
Compilation documents are aggregated from multiple Newsletter archives. The structure is as follows:9.6 Document Status State Machine
Every document in the system has adoc-status field that follows this state machine: