Project Structure
Projects using rendercss will have the same general layout as renderpdf projects as seen in the example below:
└── project/
├── callback/
├── error/
├── mediaproxy/
├── rendercss/ --> new folder
├── restapi/
└── upload/
In the rendercss folder, we will include all nescessary files as below (here using Handlebars for HTML templating and WeasyPrint for PDF generation):
Example:
└── rendercss/
├── handlebars/
│ ├── default.hbs // <documentTemplate>.hbs
│ ├── header.hbs
│ ├── body.hbs
│ ├── footer.hbs
│ └── js_helpers/
│ ├── isDisable.js
│ └── prepareData.js
├── jobs/
│ ├── product.json
│ └── product.xml
├── weasyprint/
│ ├── default.css
│ └── default.js
├── resources/
│ ├── fonts/
│ ├── images/
│ └── icc-profiles/
└── config.ion
| Folder / File Name | Definition |
|---|---|
| handlebars | contains all handlebars template files. Must have default.hbs as entry point since default is the default documentTemplate. |
| handlebars/js_helpers | contains all JavaScript helper scripts |
| jobs | contains data input (support JSON / XML) |
| weasyprint | rendering engine folder. It contains: - default.css: styling for the template- default.js: additional JS function if supported by the PDF generator |
| resources | contains static files that are used in the template (fonts, images, etc) |
| config.ion | contains all variables to config rendercss worker. E.g.: { See rendercss configuration |