Skip to content

Commit

Permalink
Documentation: ditaa: pick command invocation from env vars
Browse files Browse the repository at this point in the history
Currently the ditaa command is invoked directly and assumes that
binfmt_misc support is enabled on the host to execute ditaa via jexec
or jarwrapper. However that is not true in all cases (e.g. docker
guests does not yet properly support binfmt_misc).

This commit adds support for command invocation customization with two
environment variables: SPHINX_DITAA_CMD to specify the executable and
SPHINX_DITAA_ARG to specify a list of parameters.

Signed-off-by: Octavian Purdila <tavi@cs.pub.ro>
  • Loading branch information
tavip committed Mar 3, 2020
1 parent 96a0222 commit c5c5420
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Documentation/sphinx/ditaa.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,18 @@ def setup(app):
#latex=(latex_visit_ditaa, None),
)
app.add_directive('ditaa', Ditaa)
app.add_config_value('ditaa', 'ditaa', 'html')
app.add_config_value('ditaa_args', [], 'html')

try:
ditaa_cmd = os.environ['SPHINX_DITAA_CMD']
except:
ditaa_cmd = 'ditaa'

try:
ditaa_arg = os.environ['SPHINX_DITAA_ARG'].split(':')
except:
ditaa_arg = []

app.add_config_value('ditaa', ditaa_cmd , 'html')
app.add_config_value('ditaa_args', ditaa_arg, 'html')
app.add_config_value('ditaa_log_enable', True, 'html')
app.connect('doctree-read', on_doctree_resolved)

0 comments on commit c5c5420

Please sign in to comment.