Compilation
SECTION 14 — COMPILATION DOCUMENT WORKFLOW
14.1 What a Compilation Is
A Compilation is a single aggregated document covering one week’s worth of Newsletter data. It includes:- An index of all news categories covered during the week.
- Highlighted headlines randomly selected from each day’s Newsletter.
- The Current Affairs Q&A tables from each date in the range.
- The full outline (all news headlines) from each date.
- The complete news content organised by category, then by date within each category.
14.2 Trigger Mechanism
Automatic (Cron-Based)
- Google Cloud Scheduler triggers a backend job on the following dates each month at the configured trigger time (default: 6:00 PM IST, GMT +5:30). The trigger time is configurable by the Editor in their settings per Organisation.
- 7th → aggregates Newsletters from 1st–7th (inclusive of documents produced on the 7th before trigger time)
- 14th → aggregates Newsletters from 8th–14th
- 21st → aggregates Newsletters from 15th–21st
- Last day of month → aggregates Newsletters from 22nd–end of month
- All Compilation documents support multilingual aggregation in parallel as configured by the Teacher’s requirements or as manually triggered by the Editor during the processing queue.
Manual (Editor On-Demand Override)
- Editor can initiate a Compilation creation at any time from their RBAC dashboard.
- Manual creation UI provides two selection modes:
- Cherry-pick mode: Editor selects specific Newsletter documents individually.
- Date range mode: Editor defines a custom start and end date — all Newsletters in that range are included.
- Manual creation overrides the standard weekly date boundaries.
- Manual Compilations follow the same pipeline and output format as auto-triggered ones.
14.3 Newsletter Eligibility Rules
14.4 Compilation Creation Pipeline
- Aggregation: Backend collects all eligible Newsletters within the date range.
- Structure Assembly: Backend builds the Compilation document structure (index, highlights, current affairs tables, outlines, full content).
- Highlight Selection: System randomly selects 2 news headlines from each date’s Newsletter for the “Highlights” section.
- Document Creation: A single Compilation document is created in the database.
- Image Folder: A single image folder with sub-folders per news category is created:
WKn-MMMYY/CATEGORY1/,WKn-MMMYY/CATEGORYn/, etc. - Editor Review: Compilation document enters Editor’s queue (same RBAC pipeline as Newsletter).
- PDF Generation: Editor reviews and approves → WeasyPrint generates the Compilation PDF using the themed compilation template.
- Proofreading Check: Editor completes proofreading verification.
- Drive Upload: Editor completes process by uploading final Compilation PDF to:
YYYY/MMMYY/WEEKLY/FINAL/WKn-COMPILATION-MMMYY.pdf.
14.5 Compilation File Naming Convention
Replace
WK1 with WK2, WK3, WK4 per the week serial number.