Closed danyill closed 4 years ago
Yes you are correct, if we are reading from the file system, we should use normalizeSystemPath
.
Here's what Asciidoctor Diagram is doing: https://github.com/asciidoctor/asciidoctor-diagram/blob/66876e9c11c401eec943ff6968cd0c5f6c443906/lib/asciidoctor-diagram/diagram_processor.rb#L317
When reading a file in an Antora environment, I think we should keep the target as-is. In a browser environment, I'm not 100% sure but I think we should also keep the target as-is.
Feel free to submit a pull request, I will gladly merge it 🤗
I can't currently get the macro form to function correctly.
For the asciidoc syntax:
I get an error in my rendered HTML:
ENOENT: no such file or directory, open 'test.puml' - plantuml::test.puml[]
I looked at:
https://github.com/Mogztter/asciidoctor-kroki/blob/1daf269b6524a1ad42793ca9f26430db34405b43/src/asciidoctor-kroki.js#L136-L142
When I look in the debugger at
vfs.read(target)
I see that we havetarget
=test.puml
and this doesn't exist where it is being read from (probably the directory the process is being executed from which in this case may not be the same folder the source file is in).Perhaps all we want is:
parent.getDocument().normalizeSystemPath('test.puml')
which seems what is done in (random example): https://github.com/asciidoctor/asciidoctor-extensions-lab/blob/b848e53b5a23134348ac40741a3d777fcb22c684/lib/implicit-header-include-processor/extension.rb#L8-L10