sphinx-contrib / plantuml

BSD 2-Clause "Simplified" License
117 stars 44 forks source link

uml is not rendered if location path of plantuml.jar contains space on Windows. #73

Closed richMetellus closed 1 year ago

richMetellus commented 1 year ago

I have a document store on on my school onedrive. Ex: a path like C:\Users\<username>\OneDrive - Florida State University System,

My conf.py have the following input

### Setup for plantuml
on_rtd = os.environ.get('READTHEDOCS') == 'True'
if on_rtd:
    plantuml = 'java -Djava.awt.headless=true -jar /usr/share/plantuml/plantuml.jar'
else:
    plantuml = 'java -jar %s' %  os.path.realpath(os.path.join(os.path.dirname(__file__), os.pardir, "tools", "plantuml.jar"))
    print("plantuml path:", plantuml)
    plantuml_output_format = 'png'

under doc/tools/plantuml.jar, I have my plantuml jar file.

If I try to render the basic example shown below it will not render unless I put the documentation somewhere that do not contain space in the plantum.jar file path.

.. uml::

   Alice -> Bob: Hi!
   Alice <- Bob: How are you?
yuja commented 1 year ago

Try list notation:

plantuml = ["java", "-jar", os.path.realpath(os.path.join(os.path.dirname(__file__), ...]

The path could also be quoted, but I don't remember the exact rule.

richMetellus commented 1 year ago

Thanks @yuja .