sphinx-contrib / plantuml

BSD 2-Clause "Simplified" License
113 stars 40 forks source link

Specifying a relative path to plantuml wrapper script on conf.py #70

Closed kiteloopdesign closed 1 year ago

kiteloopdesign commented 1 year ago

Hi,

As mentioned on the docs, rather than calling java from conf.py, I am using a wrapper script to do it. However, as opposed to adding the script to $PATH, I would like to just point to where it lives with respect to the root folder, like so:

plantuml = './scripts/plantuml.sh'

Doing so results in a WARNING which doesn't offer too much more info (neither building with more verbose output does)

WARNING: plantuml command './scripts/plantuml.sh' cannot be run

Using the full path on conf.py or adding it to $PATH does work.

plantuml = '/full/path/to/script/plantuml.sh'

Any idea? Thanks

yuja commented 1 year ago

Since conf.py is Python script, you can probably use os.path.join(os.path.dirname(__file__), 'whatever-script') to get conf-relative path.

https://docs.python.org/3/library/os.path.html

plantuml command is executed at the document directory. That's why relative command path doesn't work.

kiteloopdesign commented 1 year ago

Thanks Yuja-San 🙏🏼