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

How to save png files locally? #365

Closed
ivanmanning opened this issue Apr 29, 2022 · 5 comments
Closed

How to save png files locally? #365

ivanmanning opened this issue Apr 29, 2022 · 5 comments
Labels
duplicate This issue or pull request already exists

Comments

@ivanmanning
Copy link

Hi,

On the documentation page, it says that by default, Asciidoctor Kroki generates a link, to a Kroki server or a local file. To change the default for SVG diagrams, set the kroki-default-options attribute.

So, how can I make it to save the images locally, and use that image instead of the link to the Kroki server?
Thanks.

Here is my test example:

= BOOK title
:chapter: 6
:sectnums:
:figure-caption: {chapter}.
:listing-caption: {chapter}.
:table-caption: {chapter}.
:leveloffset: 1
:imagesoutdir: E:\images\test
:kroki-default-options: inline

= CHAPTER title

Diagram test

[graphviz, "abcd-flowchart", svg]
----
digraph G { rankdir=LR; Graphviz->AsciiDoc->HTML}
----

And this is the command I'm using to create XML file:

asciidoctor -r asciidoctor-kroki -b docbook test.adoc

And this is the result I get:

<?xml version="1.0" encoding="UTF-8"?>
<?asciidoc-toc?>
<?asciidoc-numbered?>
<article xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:lang="en">
<info>
<title>BOOK title</title>
<date>2022-04-29</date>
</info>
<section xml:id="_chapter_title">
<title>CHAPTER title</title>
<simpara>Diagram test</simpara>
<informalfigure role="kroki">
<mediaobject>
<imageobject>
<imagedata fileref="https://kroki.io/graphviz/svg/eNpLyUwvSizIUHBXqFYoSszLTskssvUJslZwB4mWZVbp2jkWJ2dmuuQn69p5hPj61AIArUgQ9Q=="/>
</imageobject>
<textobject><phrase>abcd-flowchart</phrase></textobject>
</mediaobject>
</informalfigure>
</section>
</article>
@ggrossetie
Copy link
Member

This feature is not implemented in the Ruby extension, see: #156

@ivanmanning
Copy link
Author

Thank you for your reply, I appreciate it.
Do you have in plan to implement it? And when?

@ggrossetie
Copy link
Member

I don't have time right now but feel free to submit a pull request.

@ivanmanning
Copy link
Author

I'd love to but I'm not a Ruby developer

@ggrossetie
Copy link
Member

I wasn't either before I start contributing to Asciidoctor. That's a good opportunity to learn a new language!

@ggrossetie ggrossetie added the duplicate This issue or pull request already exists label May 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants