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

plantuml and data-uri don't work together ? #738

Closed
bric3 opened this issue Nov 27, 2018 · 2 comments
Closed

plantuml and data-uri don't work together ? #738

bric3 opened this issue Nov 27, 2018 · 2 comments

Comments

@bric3
Copy link

bric3 commented Nov 27, 2018

Hi,

I'd like to inline plantuml diagrams in my html5 document, however I cannot seem to get it right.
Either I have difficulty to find the right way to use the data-uri scheme to inline images for images generated by asciidoctorj-diagram in plantuml format. And even using inline SVG don't results in inlined document.

:doctype: book
:icons: font
:source-highlighter: coderay
:toc: left
:toclevels: 4
:sectlinks:
:sectanchors:
:docinfo:
:nofooter:
:data-uri:

:description: documentation

:logo: images/xxxxxxxxxxx.png

image:{logo}[text]

[plantuml, "flow", svg, opts="inline", height="100%", width="100%"]
----
title flow
autonumber

user -> client : access
----


[plantuml, "flow2", png]
----
title flow
autonumber

user -> client : access
----

With :data-uri:

The real png image used in image:{logo} is correctly transformed as a data-uri. But the images generated for the plantuml diagram don't work. I got the following warnings.

/absolute/path/to/src/docs/asciidoc/index.adoc: SVG does not exist or cannot be read: /absolute/path/to/src/docs/asciidoc/flow.svg
image to embed not found or not readable: /absolute/path/to/src/docs/asciidoc/flow2.png

without :data-uri:

The inlined SVG doesn't work anyway the generated HTML looks like that

<div class="imageblock">
<div class="content">
<span class="alt">flow</span>
</div>
</div>

Versions

I'm generating the doc within a gradle build :

buildscript {
    dependencies {
        classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.8.1'
    }
}

dependencies {
    asciidoctor "org.asciidoctor:asciidoctorj-diagram:1.5.10"
}

asciidoctorj {
    version = "1.5.7"
}

asciidoctor {
    requires 'asciidoctor-diagram'
    options doctype: 'book'
    attributes = ['source-highlighter': 'coderay',
                  'encoding'          : 'utf-8',
                  'version'           : project.version,
                  'build-timestamp'   : Instant.now().toString(),
                  'commit'            : commit.id ]
    sources {
        include 'index.adoc'
    }

    // enforce asciidoc processing
    // outputs.upToDateWhen { false }
}

References

@bric3
Copy link
Author

bric3 commented Nov 27, 2018

It seems that this issue is similar to mine but it's related to the ruby version of asciidoctor-diagram : asciidoctor/asciidoctor-diagram#198

It seems asciidoctorj-diagram has been moved from this repo to its own project, so I created a ticket hoping this will fix my issue : asciidoctor/asciidoctorj-diagram#1
Because at this time it's a bit confusing.

@bric3 bric3 changed the title plantuml and dat-uri don't work together ? plantuml and data-uri don't work together ? Nov 29, 2018
@robertpanzer
Copy link
Member

Closing as asciidoctor/asciidoctorj-diagram#1 has been closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants