Skip to content
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

Implement the kroki-default-options logic in the Ruby library #156

Open
ggrossetie opened this issue Oct 11, 2020 · 6 comments
Open

Implement the kroki-default-options logic in the Ruby library #156

ggrossetie opened this issue Oct 11, 2020 · 6 comments
Labels
🍩 enhancement New feature or request 💎 Ruby

Comments

@ggrossetie
Copy link
Member

Currently, this feature is only available in JavaScript:

https://github.com/Mogztter/asciidoctor-kroki/blob/bca1ec83711989b0b1318222843eeac341e22c40/src/asciidoctor-kroki.js#L37-L59

@edl7878
Copy link

edl7878 commented Oct 30, 2020

Can we use kroki in asciidoctor binary?

Use it in asciidoctor.js is cool. I'd say, use kroki with vscode-asciidoctor, the experience is fabulous.

But when you use hugo with asciidoc, you need asciidoctor to render adoc files, at this time, if you want diagram, you can't use kroki, because there is no kroki plugin with asciidoctor binary.

Is it possible to use it with asciidoctor?

@ggrossetie
Copy link
Member Author

Can we use kroki in asciidoctor binary?

Do you mean with the Asciidoctor (Ruby) CLI?
If so, I need to document it but you can use the --require (or -r) to require the Ruby library:

$ gem install asciidoctor-kroki
$ asciidoctor -r asciidoctor-kroki doc.adoc

The JavaScript and Ruby implementation have a few differences but we are trying to fill the gap.

But when you use hugo with asciidoc, you need asciidoctor to render adoc files, at this time, if you want diagram, you can't use kroki, because there is no kroki plugin with asciidoctor binary.

Reading Hugo documentation, I think you should add asciidoctor-kroki in extensions: https://gohugo.io/content-management/formats/#external-helper-asciidoctor

If it's working we should probably update the documentation to state that asciidoctor-kroki is a possible value.

@edl7878
Copy link

edl7878 commented Oct 31, 2020

Checked the Hugo doc, asciidoctor-kroki not in the possible extensions of hugo, for now.

A proposal has been raised:

gohugoio/hugo#7911

@edl7878
Copy link

edl7878 commented Nov 2, 2020

I have made a PR of hugo which tries to make asciidoctor-kroki a possible extension.

gohugoio/hugo#7919

Or, you can build the PR yourself for instant use of asciidoctor-kroki with hugo right now, below just the hugo serve output:

INFO 2020/11/02 13:39:14 Rendering \c.adoc with C:\Ruby27-x64\bin\asciidoctor.bat using asciidoctor args [-r asciidoctor-html5s -r asciidoctor-kroki -a data-uri=1 -a kroki-server-url=https://XXX.com --base-dir C:\Users\roger\n\hugo\hugoTestSite\content -a outdir=C:\hugoTestSite\public\c --no-header-footer -] ...

Part of rendered page:

image

@ggrossetie
Copy link
Member Author

Thanks @edl7878 🎉

I've created #166 to document how to use the Ruby library. We could probably also explain how to integrate it in Hugo once your pull request is merged.
Feel free to add a comment in #166.

@edl7878
Copy link

edl7878 commented Nov 2, 2020

Yes, if the pull request is merged, then the workflow is flawless, and I will explain how to integrate it in Hugo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍩 enhancement New feature or request 💎 Ruby
Projects
None yet
Development

No branches or pull requests

2 participants