asciidoctor-diagram icon indicating copy to clipboard operation
asciidoctor-diagram copied to clipboard

plantuml:: directive file specification not working according to documentation

Open alwyn opened this issue 4 years ago • 2 comments

Hi,

I am using gradle with version 3.2.0 of org.asciidoctor.jvm.convert and org.asciidoctor.jvm.pdf plugins. I'm not sure which version of asciidoctor-diagram this pulls in.

Default sourceDir is src/docs/asciidoc.

The documentation for asciidoctor-diagram states for the diagram block macro: When the source file name is a relative path it is resolved with respect to the location of the document being processed.

My main document is under src/docs/asciidoc and it contains a plantuml:: directive uml/a.puml for a file located at src/docs/asciidoc/uml/a.puml

The intellij plugin for asciidoc correctly parses and displays the image inline. BUT, when I build using gradle it expects to find the file in the root folder of the project and not relative to the document being processed.

The workaround is to use plantuml::src/docs/asciidoc/uml/a.puml, BUT then the inline rendering of intellij doesn't find the file.

Ideal solution: It works as documented in all environments.

My build configuration:

plugins {
	id("org.asciidoctor.jvm.convert") version "3.2.0"
	id("org.asciidoctor.jvm.pdf") version "3.2.0"
}

asciidoctorj {
	modules {
		diagram.use()
	}
	options(mapOf(
			"doctype" to "book"
	))
	attributes(mapOf("toclevel" to "2"))
}

tasks {
	asciidoctor {
		dependsOn(asciidoctorPdf)
	}
}

alwyn avatar Jul 17 '20 18:07 alwyn

I think this is more an issue with the gradle plugin than with the diagram extension itself. I'm not too familiar with the java based derivatives I'm afraid. @robertpanzer Any tips on how to debug this kind of thing?

pepijnve avatar Mar 29 '21 19:03 pepijnve

I just tried a small sample build with a document that contains a plantuml macro and it worked fine for me:

I used this build.gradle with Gradle 6.7:

buildscript {
    repositories {
        jcenter()
        mavenLocal()
    }
}
plugins {
        id 'org.asciidoctor.jvm.convert' version '3.2.0'
        id 'org.asciidoctor.jvm.pdf' version '3.2.0'
}

asciidoctorj {
    modules {
       diagram.use() 
       diagram.version '2.1.1' 
       pdf { 
           version '1.5.4'
       }
    }
}

repositories {
    mavenLocal()
    jcenter ()
}

And this asciidoc file under src/docs/asciidoc/test.adoc:

= Test
:source-highlighter: rouge

== Test

[plantuml,test,png]
----
A --> B
----

robertpanzer avatar Mar 30 '21 08:03 robertpanzer