Closed bharatrajagopalan closed 1 year ago
As I am using the plantuml-markdown
plugin with mkdocs-material
' I submitted this pull requestto the plantuml-markdown team which lets the base theme be configured at plugin level and sent using the !theme
directive.
It is interesting that there are a few commands that error out when !theme
is used, e.g. version
, listfonts
, stdlib
- so I have created an exception list that can be configured in the plugin. It would be nice if plantuml would just ignore the theme directive in such cases rather than error out to simplify.
Is there a full list of such commands available somewhere? Currently I configured this based on searching different parts of the site and testing.
You can set the environment-var PLANTUML_CONFIG_FILE
to the path of your config which injects the theme.
@Ruakij I guess that variable is more intended to be used when using the jar file; when using the server, I am guessing that it needs to be set as a variable at the server side and is not something that can be passed in GET/POST request?
Sorry, the Servlet doesnt have anything for that.
Shouldnt be too hard to add though.
theme
parameter or HTTP-headertheme/<theme>
Of course more clean would be to load at startup, index available themes/configs and then return out of memory. More memory usage, negligible - faster response, but as the system caches anyways shouldnt be too bad.
Thats already done with the config here.
EDIT: Okay, config isnt read every time but lazy-loaded, my bad.
Makes sense - I will close this issue for now, but will look into the above when I get some time.
For now my pull request that I have above for plantuml-markdown
does the job, so not urgent
Feel free to use the work i have begun: https://github.com/Ruakij/plantuml-server/tree/feat_themeFromRequest
Unfortunately its broken, the UrlDecode from path throws an Exception. Maybe you can find whats wrong.
in the jar file one could use the
-theme
directive in the command line to select a default theme for the server. How does one achieve that with the plantuml server.And is there a way to pass a custom theme url as an argument to the server without the
!theme
directive in the puml file?Trying to setup an internal plantuml server for use and trying to simplify - enforce a default theme at server level, rather than having to have consumers use the
!theme
directive in every plantuml file they create.