Closed Analect closed 6 years ago
I don't have a Windows machine to test, bu try this plantuml.bat
:
"C:\Program Files\Java\java" -jar plantuml.jar %1 %2 %3 %4
Check where is the java.exe
in your system and adjust the path in the above script.
Place the plantuml.jar
in the same folder of the plantuml.bat
.
Then add then path where you placed the plantuml.bat
to the system path (search in Internet how to change the PATH
variable in Windows).
Or, for a quick test, copy the plantuml.bat
and plantuml.jar
in C:\Windows
; it's a bit dirty but for testing may be done.
To test if the installation is working, simply try the command plantuml
, without arguments and it should open a dialog.
@mikitex70 On my win10 machine python subprocess has problems finding the .bat file.
I need add either the .bat extension to the command ( ugly )
cmdline = ['plantuml.bat', '-p', outopt ]
or add the shell = True option
p = Popen(cmdline, stdin=PIPE, stdout=PIPE, stderr=PIPE, shell=True)
in plantuml.py. The latter would make it compatible both under linux and win.
my plantuml.bat:
@echo off
set mypath=%~dp0
setlocal
set GRAPHVIZ_DOT=%mypath%\Graphviz\bin\dot.exe
java -jar %mypath%\plantuml.jar %*
I also placed the graphviz folder in the same path
Hi @henn1001, thanks for your suggestions.
I've commited the version 1.2.5
, that can now be installed with a simple pip install plantuml-markdown
. In this version I've added a workaround to let Windows find and run the batch file.
I've added a test for the operating system because using shell=True
for some reason will broke automated tests under Linux (plantuml will open a dialog).
I hope the workaround will work fine.
Thanks again for your Windows batch file, it is now mentioned in the documentation.
When will 1.2.5 be available on "pip install" ? I'm only able to get 1.2.4 and I need the above fix.
Thanks a lot.
Hi @vstriz, sorry for the mistake: I've uploaded only the package for Python 3.
It's my first release and I still learning.
But now I've uploaded also the package for Python 2.7, so try again with pip
.
Thank you @mikitex70 for answering. I was really hoping it would work but it still doesn't seem to find it. I'm a little beyond my depth here to figure out why though. AFAICT it still doesn't find python-2.7 package for version 1.2.5 with pip
You can check on pypi.org available packages:
https://pypi.org/project/plantuml-markdown/1.2.5/#files
vs.
https://pypi.org/project/plantuml-markdown/1.2.4/#files
You will see that 1.2.5 still doesn't have "py2" package
Ok, now there is also a 1.2.5 package for Python 2.7. I hope now is all ok.
Thank you @mikitex70. It works now.
@mikitex70 I've been trying to get this working on windows 7, but am somehow stuck. Perhaps you may have some pointers.
The jar file is located here:
c:\plantuml\plantuml.jar
I have created a bash file and saved it as
c:\plantuml\plantuml.sh
I'm running mkdocs in a conda environment called 'client-docs', so have copied
plantuml.py
toc:\Users\xxxx\AppData\Local\Continuum\Miniconda3\envs\client-docs\Lib\site-packages\markdown\extensions\plantuml.py
.In order to call the bash file above with a single
plantuml
command, I have set an alias using doskey:doskey plantuml=bash "c:\plantuml\plantuml.sh"
In the mkdocs.yml, I have:
However, when I try to run
mkdocs serve -a 0.0.0.0:8000
, I get an exception from the plantuml.py above:Any thoughts on what I might be doing wrong here? Thanks