How oleksiy-nesterov/publication-builder works
Publication Builder turns a publication folder of HTML/Nunjucks pages, CSS, templates, and assets into web output or PDFs, with a live-preview route for authoring. The build entry point loads publication metadata, renders pages and styles, resolves assets, then writes web output or invokes Vivliostyle for PDF targets. The README documents fixed-page catalogues, automatically paginated books, reusable templates, local data formats, print TIFF replacements, and CMYK processing; the graph preserves these capabilities while some implementation details remain unsampled.
Main entry points: buildApi.ts Build orchestration · renderApi.ts Publication rendering · devApi.ts Live preview · templateApi.ts Template and file rendering
Components 18
Entry and preview
- Build command
src/index.ts - Live preview
src/api/devApi.ts
Publication content
- Publication metadata
publications - Pages and data
publications - Reusable templates
publications - Styles and assets
publications
Rendering
- Publication loader
src/api/publicationApi.ts - Template and file rendering
src/api/templateApi.ts - Local file helpers
src/api/fileApi.ts - Asset resolution
src/resolvers/assetResolver.ts - CSS collection
src/resolvers/cssResolver.ts - Publication rendering
src/api/renderApi.ts
Build outputs
- Build orchestration
src/api/buildApi.ts - Static web output
- PDF output
Other components
- Publication author
- Vivliostyle
- Browser preview
Connections 22
- Publication author → Build command: selects target
README.md - Build command → Build orchestration: starts build
src/index.ts - Build orchestration → Publication loader: loads metadata
src/api/buildApi.ts - Publication loader → Publication metadata: reads manifest
README.md - Publication loader → Pages and data: validates pages
src/api/publicationApi.ts - Build orchestration → Publication rendering: renders publication
src/api/buildApi.ts - Publication rendering → Template and file rendering: renders pages
src/api/renderApi.ts - Publication rendering → Asset resolution: resolves assets
src/api/renderApi.ts - Publication rendering → CSS collection: collects styles
src/api/renderApi.ts - Template and file rendering → Reusable templates: resolves templates
README.md - Template and file rendering → Local file helpers: provides file access
src/api/templateApi.ts - Template and file rendering → Asset resolution: resolves local assets
src/api/templateApi.ts - CSS collection → Styles and assets: collects CSS
src/resolvers/cssResolver.ts - Asset resolution → Styles and assets: resolves publication assets
README.md - Build orchestration → Static web output: writes web build
README.md - Build orchestration → Vivliostyle: generates PDF
README.md - Vivliostyle → PDF output: writes PDF
README.md - Publication author → Live preview: requests preview
README.md - Live preview → Publication loader: loads publication
src/api/devApi.ts - Live preview → Publication rendering: renders request
src/api/devApi.ts - Live preview → Browser preview: serves pages
src/api/devApi.ts - Styles and assets → Asset resolution: print TIFF substitution
README.md