Closed akosma closed 4 years ago
Of course this PR is only meant to be used with Node.js on the command line, since it might not be feasible on a browser context.
I just realized you created node-plantuml
– hopefully this PR might be useful in that context too!
Any feedback about this PR?
Hello? Anyone?
Anyone here?
I'm facing the same problem, see https://github.com/eshepelyuk/asciidoctor-plantuml.js/issues/53#issuecomment-569049207
It would bve very usefull for usage in vscode editor plugin
How can we help to integrate this?
Thanks!
@akosma can you provide your forked version in npm? See the issue asciidoctor-plantuml.js ? This would be perfect :)
published from my fork as scoped package @anb0s/plantuml-encoder@1.5.1
Thanks @akosma !
Hi! Sorry for the long delay and thanks for contributing.
As this is for Node.js only the code should be put somewhere it will not affect the browser code. encoder.js is shared code between browser and Node.js. The easiest solution is probably to put it in index.js which is Node.js only and wrap the encode function.
I also think this feature should be behind an option that is off by default as it could potentially break usage where someone want to encode and decode while keeping the same include.
It could look something like this using an optional options object:
plantumlEncoder.encode(umlWithInclude, { resolveIncludes = true })
I'm not using this code anymore, as I found a solution to stop using asciidoctor-plantuml completely. Closing this PR.
@akosma That is so sad, but anyway can you share the solution for other PlantUML users?
This PR provides the basic infrastructure to resolve PlantUML
!include
statements before encoding.This can be useful in cases for example in complex setups such as Antora where all PlantUML files share the same configuration through an
!include
statement. See this issue for a practical example of what kind of problems this could solve.I have run the
npm run build
command, and added some tests, they all pass.Thanks!