Example plugin for the DSW Document Worker.
This is just an example how to create a plugin for the DSW Document Worker.
- plugin.py - contains hook implementations for the DSW Document Worker
- step.py - contains a Step implementation for the DSW Document Worker
This plugin uses all three hooks:
- Adds
ExampleStep
viaprovide_steps
hook, this step results in plain text document containing static text as implemented instep.py
. - Adds extra
example
field to the document context viaenrich_document_context
hook. - Adds example Jinja filter, test, and global variable via
enrich_jinja_env
hook.
It is important that pyproject.toml
contains the following section:
[project.entry-points.dsw_document_worker_plugins]
example = 'dsw_docworker_example_plugin.plugin'
With the plugin (or eventually more plugins) ready, you can build a new Docker image while extending the base image with the plugin(s) and then run the DSW Document Worker with the new image as shown in Dockerfile.
This project is licensed under the Apache License v2.0 - see the LICENSE file for more details.