-
-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[kroki-fetch-diagram] generated-file-name parameter not used #48
Comments
I need to check how Asciidoctor diagram resolve conflicts: [plantuml, "diagram-classes", svg]
....
....
[plantuml, "diagram-classes", svg]
....
.... As far as I understand, the last diagram will win: https://github.com/asciidoctor/asciidoctor-diagram/blob/66876e9c11c401eec943ff6968cd0c5f6c443906/lib/asciidoctor-diagram/diagram_processor.rb#L181 |
Yes it overwrites the file and it's OK, because i think conflict resolution would be complex to implement and user is responsible to use unique names or just not enter any generated-file-name to have it generated and unique... |
@anb0s If you want to give it a try, the line to update is: The "diagramName" (ie. file name) should be: |
Thanks, i will see how to create own version of asciidoc-kroki and try it.
I think we still need the auto-generated name, because target is optional: So if target is empty, or how ever it's passed as if not valid/given, then it should still use the code with |
Awesome, let me know if you need help to setup the project on your machine.
Oh you're right. I believe that Asciidoctor Diagram is using the following code when the file name (ie. target) is absent: https://github.com/asciidoctor/asciidoctor-diagram/blob/66876e9c11c401eec943ff6968cd0c5f6c443906/lib/asciidoctor-diagram/diagram_source.rb#L156 |
@Mogztter i'm new to JS and tried to setup dev environment with npm @ windows (the only system at work :( ), but no luck:
I think windows is not good env for development and i will use my manjaro linux system at home. But if it should work at windows please give me a hint :) |
@anb0s the stacktrace is very vague... my guess is that Puppeteer cannot launch an headless Chrome. Could you please try to run |
I've enabled
|
@anb0s Did you install the dependencies using If you did, could you try to execute |
@Mogztter yes i've tried the steps described. I see no warnings. After more research i've executed 6 Test failed:
|
That's better! Edit: confirmed, I have the same result: https://github.com/Mogztter/asciidoctor-kroki/pull/66/checks?check_run_id=660834778. It's related to new lines being |
Yes this test fails, because of line separator expected
|
created new issue #68 for failed tests @ windows, continue there :) |
The linked PR is closed, however this issue is still open. In my trials (using the RubyGem), it appears that the custom / human-readable name is still ignored (https://github.com/Mogztter/asciidoctor-kroki/blob/master/ruby/lib/asciidoctor/extensions/asciidoctor_kroki/extension.rb#L291). Is that accurate? If so, is the plan still to support the custom name, or is there a reason for always using the auto-generated name? I'd be glad to help get this resolved. |
It was reverted because we are using the filename as the cache key: #90 |
Thank you for providing that context. Now that I understand the challenges, I'd like to propose an alternate approach. As a user, I don't necessarily want to control the entire filename. Rather, my wish is to be able to control the filename so I'm able to recognize which diagram file goes with which diagram. To achieve that goal, I propose using the diagram name specified on the block as the filename prefix in place of |
That's a good idea!
I agree, let's do that 👍🏻 |
Currently, |
@vy could you please open a new issue since this one is closed, thanks! |
see #47 for my setup
My test presentation.adoc sets the
imagesdir
and usegenerated-file-name
parameter to have all images with human readable names:It fetches the diagram and writes to
images/210a0ebf2a7bb40669c4e3c895b2c9396f048327.svg
instead ofimages/diagram-classes.svg
like ascidoctor-diagram does.It would be good to support the mandatory diagram parameters from asciidoctor-diagram.
The text was updated successfully, but these errors were encountered: