Worker for assembling and transforming documents
- MongoDB (with GridFS)
- RabbitMQ
- wkhtmltopdf
- pandoc
We are using HTML Jinja2 templates described by a JSON file within specified directory. The JSON file can look like this:
{
"uuid": "4bfe909b-7dbc-40a7-8609-085e9af1df98",
"name": "My cool template",
"rootFile": "my/relative/dir/index.html.j2",
"wkhtmltopdf": "",
"pandoc": ""
}The wkhtmltopdf and pandoc fields are optional and you can specify extra command line options and arguments for calls of those commands for converting document. Path specified in rootFile is relative to JSON file, then paths in Jinja2 are relative to the root file.
Docker image is prepared with basic dependencies and worker installed. It is available though Docker Hub: datastewardshipwizard/document-worker.
You can easily build the image yourself:
$ docker build . -t docworker:local/app/config.yml= configuration file (see example)/app/templates= directory with templates/usr/share/fonts/<type>/<name>= fonts according to Debian wiki (for wkhtmltopdf)
We bundle Docker image with default fonts (for PDF generation, see fonts folder):
- Noto Fonts (some variants)
- Symbola
This project is licensed under the Apache License v2.0 - see the LICENSE file for more details.