mirror of
https://github.com/TheAnachronism/docspell.git
synced 2024-11-13 02:31:10 +00:00
8269a73a83
Allows to configure external commands and provide different arguments based on runtime values, like language. It extends the current config of a command to allow a `arg-mappings` section. An example for ocrmypdf: ```conf ocrmypdf = { enabled = true command = { program = "ocrmypdf" ### new arg-mappings arg-mappings = { "mylang" = { value = "{{lang}}" mappings = [ { matches = "deu" args = [ "-l", "deu", "--pdf-renderer", "sandwich" ] }, { matches = ".*" args = [ "-l", "{{lang}}" ] } ] } } #### end new arg-mappings args = [ ### will be replaced with corresponding args from "mylang" mapping "{{mylang}}", "--skip-text", "--deskew", "-j", "1", "{{infile}}", "{{outfile}}" ] timeout = "5 minutes" } working-dir = ${java.io.tmpdir}"/docspell-convert" } ``` The whole section will be first processed to replace all `{{…}}` patterns with corresponding values. Then `arg-mappings` will be looked at and the first match (value == matches) in its `mappings` array is used to replace its name in the arguments to the command. |
||
---|---|---|
.. | ||
addonlib/src | ||
analysis/src | ||
backend/src | ||
common/src | ||
config/src | ||
convert/src | ||
extract/src | ||
files/src | ||
fts-client/src/main/scala/docspell/ftsclient | ||
fts-psql/src | ||
fts-solr/src/main/scala/docspell/ftssolr | ||
joex/src | ||
joexapi/src/main | ||
jsonminiq/src | ||
logging | ||
notification | ||
oidc/src | ||
pubsub | ||
query | ||
restapi/src/main | ||
restserver/src | ||
scheduler | ||
store/src | ||
totp/src | ||
webapp |