Closed tpchris1 closed 3 years ago
@tpchris1 I see you're using Anaconda -- can I ask how you installed it, and which version? I'll try to reproduce this as I'm not quite sure from the above.
OS: Win10
Environment: using VS code with anaconda prompt in the terminal of VS code
Anaconda version: 4.7.12
python package version: mkdocs 1.1.2 mkdocs-drawio-exporter 0.6.1 mkdocs-material 5.5.13 mkdocs-material-extensions 1.0.1 mkdocs-mermaid2-plugin 0.4.2
I hope nothing is missed here ; ) Thank you!
Hey @tpchris1, I tried this out locally and I was able to export diagrams without the drawio_executable
option set, as the plugin correctly determined the location:
> mkdocs build -v
[snip]
DEBUG - Trying paths ['C:\\Program Files\\draw.io\\draw.io.exe', 'ProgramFiles(x86)\\draw.io\\draw.io.exe'] for platform "win32"
DEBUG - Found Draw.io executable for platform "win32" at "C:\Program Files\draw.io\draw.io.exe"
DEBUG - Using Draw.io executable "C:\Program Files\draw.io\draw.io.exe", cache directory "\\Mac\Home\Code\avado\sre\docs-anaconda\docs\drawio-exporter" and image regular expression "(<img[^>]+src=")([^">]+)("\s*\/?>)
[snip]
Can you try again without that option set, and if it doesn't work please paste the log of mkdocs build -v
?
According to the Debug info, I am assuming that only installed in the default file path as in "C:\Program Files\draw.io\draw.io.exe" is required. However, I installed it in my custom path and it seemed that the package cannot read my passed arguments as following.
plugins:
- search
- mermaid2
- drawio-exporter:
drawio_executable: 'D:\Program_Files\draw.io\draw.io.exe'
However, I did manage to solve it by installing it in the default path 'C:\\Program Files\\draw.io\\draw.io.exe'
and remove the drawio_executable
argument.
Is it possible for you to recreate at the drawio_executable
part? Or maybe I was doing the wrong way to pass the argument?
Debug info:
DEBUG - Config value: 'plugins' = PluginCollection([('search', <mkdocs.contrib.search.SearchPlugin object at 0x000002086BF44438>), ('drawio-exporter', <mkdocsdrawioexporter.plugin.DrawIoExporterPlugin object at 0x000002086F594CC0>)])
DEBUG - Trying paths ['C:\\Program Files\\draw.io\\draw.io.exe', 'ProgramFiles(x86)\\draw.io\\draw.io.exe'] for platform "win32"
ERROR - Unable to find Draw.io executable; ensure it's on PATH or set drawio_executable option
DEBUG - Using Draw.io executable "None", arguments [], cache directory "D:\tpchris1\programming\ATE\sync\Focus_Docs\docs\drawio-exporter" and image regular expression "(<img[^>]+src=")([^">]+)("\s*\/?>)"
Could you confirm the location you'd installed Draw.io to for me, was it D:\Program_Files\draw.io\draw.io.exe
?
If so, it might be that Python is treating the backslashes in the path as escape sequences -- try using double backslashes? D:\\Program_Files\\draw.io\\draw.io.exe
may work.
Yeah, I can confirm. I tried the double back slashes and also the single/double quotation marks. Besides, I also put the install path in the SYSTEM_PATH of Windows 10 However, none of the above worked in my previous trys.
Wow, looks like there's a corker of a bug there. I think we check that the specified executable is executable and then don't actually use it. I'll fix this and push a release either today (it's nearly 9pm here!) or tomorrow; thanks for your patience @tpchris1.
@tpchris1 could you give this build a shot? If it works I'll do an 0.7 release. You'll need to unzip this and install the Python wheel inside:
mkdocs-drawio-exporter-issue-18.zip
You should need to do something like the following, inside of your venv if you're using one:
pip uninstall mkdocs-drawio-exporter
pip install mkdocs_drawio_exporter-0.6.1-py3-none-any.whl
Sure! Glad to help a bit. Really like your work here! But I am afraid I won't be able to give it a test until next Monday. I will test it by then and tell you the result! Thank you!
I have tried the issue 18 version and confirmed that it works ! Thanks for the quick fix !
The following are the current log of mkdocs build -V
DEBUG - Config value: 'plugins' = PluginCollection([('search', <mkdocs.contrib.search.SearchPlugin object at 0x0000017010674C18>), ('drawio-exporter', <mkdocsdrawioexporter.plugin.DrawIoExporterPlugin object at 0x0000017013CC11D0>), ('mermaid2', <mermaid2.plugin.MarkdownMermaidPlugin object at 0x00000170145064A8>)])
DEBUG - Using Draw.io executable "D:\Program_Files\draw.io\draw.io.exe", arguments [], cache directory "D:\tpchris1\programming\ATE\sync\Focus_Docs\docs\drawio-exporter" and image regular expression "(<img[^>]+src=")([^">]+)("\s*\/?>)"
Neat, cheers @tpchris1. Release 0.7.0 will be out momentarily, so you should be good to go once you're upgraded 👍
I just installed with the latest version on
pip
And I have installed the latest desktop version of draw.io(diagrams.net) and also tried the no-install version. However, when I configured the path in both ways, they just didn't work and kept telling me:Although, I do have my mkdocs.yml as below:
And the full path of the error messages are as follow: