Open msgilligan opened 4 years ago
Can you drop a snippet of your gradle build file in here?
The project is open source, but I haven't pushed the build file to Github yet since it doesn't work. Here's what I'm starting with:
buildscript {
repositories {
jcenter()
}
}
plugins {
id 'org.asciidoctor.jvm.convert' version '2.4.0'
id 'org.asciidoctor.jvm.pdf' version '2.4.0'
}
repositories {
jcenter()
}
def buildDocDir = file('build/doc')
asciidoctorj {
modules {
diagram.version '1.5.18'
}
}
asciidoctor {
sourceDir file("$projectDir")
sources {
include 'PaymentChannelResearch.adoc', 'RGBProtocolOverview.adoc'
}
outputDir buildDocDir
}
asciidoctorPdf {
sourceDir file("$projectDir")
sources {
include 'PaymentChannelResearch.adoc', 'RGBProtocolOverview.adoc'
}
outputDir buildDocDir
}
task renderAll(dependsOn: [asciidoctor, asciidoctorPdf])
Do not write the output of both tasks to the same folder. If you want that, rather create a Copy/Sync task that will sync from both tasks to a common folder.
Do not write the output of both tasks to the same folder. If you want that, rather create a Copy/Sync task that will sync from both tasks to a common folder.
I changed the output to separate folders and the problem remains. I believe the problem is specific to the Ditaa format which has different image-path processing than PlantUML, which works correctly.
Here 's the section of the PDF that shows the problem:
Mmm.. I've seen that before, but cannot recall how I solved it. I'll try look into this over the weekend.
In the mean-time, maybe
asciidoctorPdf {
useIntermediateWorkDir()
}
might help.
asciidoctorPdf { useIntermediateWorkDir() }
might help.
That didn't seem to help. You can see the full project and the Github Actions build here: https://github.com/msgilligan/Research/commit/f9d38fda17d8d07966455fc5efe5e3aa2b7ea217/checks?check_suite_id=365725075
If you look in the archive you can see that the rendered image wasn't included in the PDF. And you can also see the error message for the missing image on line 114:
asciidoctor: WARNING: image to embed not found or not readable: /home/runner/work/Research/Research/diag-1d92173716e045e7243d9800988c027c.png
I'm having trouble getting a Ditaa diagram to render correctly in the PDF format. I'm using the
asciidoctorPdf
task.Issue #450 reported the same problem, but was closed without explanation. The example in https://github.com/ixchelruiz/asciidoctor-gradle-diagram works for me, but it doesn't use the
asciidoctorPdf
task. The documentation does not (directly) explain how to do this nor is there an example using theasciidoctorPdf
task.