sphinx-contrib/plantuml

Feature Request: use Web service interface of plantuml

perrinjerome opened this issue · 4 comments

Instead of spawning a subprocess, it would be nice to use the "Web service mode" as described on https://plantuml.com/server . This could simplify the setup, instead of having to install java and plantuml locally, we could just use a plantuml installed in a central place.
People who don't want to bother with installing their own plantuml server can probably use https://www.plantuml.com/plantuml/

This could be a new configuration option, like plantuml_webservice_url ( default https://www.plantuml.com/plantuml/ )

About implementation detail, plantuml web service mode works by encoding the diagram source code in the URL string, like
https://www.plantuml.com/plantuml/png/SyfFKj2rKt3CoKnELR1Io4ZDoSa70000

It's described in https://plantuml.com/text-encoding and theres's a python implementation on pypi ( https://pypi.org/project/plantuml/ ) Implementation is a bit complex, so I guess it's better to depend on that package instead of reimplementing it, even if it looks trivial according to the doc.

PS: Even in html mode, I believe the image should be downloaded in _static dir and not included from the plantuml server as https://www.plantuml.com/plantuml/png/SyfFKj2rKt3CoKnELR1Io4ZDoSa70000 .

yuja commented

Seems fine as an optional feature. Patches are welcome.

Hi,

This would be a great feature!

I also suppose using https://github.com/dougn/python-plantuml would be the way to go.
Dependencies are probably best optional and thus managed with 'extras_require'.

FYI For those seeking to generate diagrams on a remote server I've just added a Gravizo Sphinx extension to sphinx-contrib that may fit your use-case (or be a temporary work-around):

https://github.com/sphinx-contrib/gravizo

It was written as a pragmatic solution to easily allow PlantUML rendering on readthedocs.io without having to pre-render locally and polluting the git repository with auto-generated files.