How the export pipeline works
- The lesson state (
{ title, sections: [{ name, blocks: [...] }] }) is turned into adocxDocumentinsrc/lib/docxExport.js. - DOCX export packs that document to a Blob and downloads it.
- PDF print (
src/lib/pdfExport.js) packs the same document, converts it to HTML withmammoth, applies print styles, and renders it to PDF withhtml2pdf.js. Using one shared document builder keeps the two outputs in sync.