The boilerplate uses the python framework flask to run the webinterface and to generate the HTML of the book. To generate the PDF it uses the javascript library pagedjs together with the chromium webbrowser in headless mode.
-`pagedjs.py` helper functions to run pagedjs-cli from python
-`utils.py` utitilities for generative books
-`templates/index.html` template for the index
-`templates/book.html` template for the book itself
-`static/style.css` css style rules for the index and book (it's possible to split them up, also adjust the templates then)
-`static/pagedjs.interface.css` css style rules provided by paged.js to have a more rich preview in debug mode
# Usage
The boilerplate essentially has two views: `index` and `generate`. The `index` shows the homepage and a link to the `generate` function. In this example the generated book is downloaded as a PDF.
The template `templates/book.html` is used with styles from `static/style.css` to generate the PDF, adjust them to adjust your book. In `app.py` the function generate loads the template, adjust that function to generate context and / or HTML.
In the [documentation of paged.js](https://pagedjs.org/documentation/) a lot of information on print specific functionality in CSS can be found.