asciidoctor / asciidoctorj-diagram

AsciidoctorJ Diagram bundles the Asciidoctor Diagram RubyGem (asciidoctor-diagram) so it can be loaded into the JVM using JRuby.
Apache License 2.0
10 stars 6 forks source link

Cannot use plantuml in subproject. #27

Open sebastianzillessen opened 1 year ago

sebastianzillessen commented 1 year ago

Hi

I am using asciidoctor-gradle-plugin (version 1.5.8.1) in a Gradle Project with subprojects.

My main build.gradle looks like this:

import org.asciidoctor.gradle.AsciidoctorTask

buildscript {
    repositories {
        maven { url "<leftout>/mvn-all-local" }
    }

    dependencies {
        classpath "org.asciidoctor:asciidoctor-gradle-plugin:1.5.8.1"
        classpath "org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.15"
        classpath 'org.asciidoctor:asciidoctorj-diagram:1.5.4.1'
        classpath 'org.asciidoctor:asciidoctorj-diagram-plantuml:1.2022.5'
    }
}

allprojects {
    group = 'leftout'
    version = '0.0.1'
}

subprojects {
    apply plugin: 'org.asciidoctor.convert'

    repositories {
        maven { url "<leftout>/mvn-all-local" }
    }

    asciidoctor {
        logDocuments true
        separateOutputDirs false
        outputDir "${buildDir}/asciidoc"
        // outputDir = file("build/docs")
        sourceDir = project.file('src/asciidoc')
        options doctype: 'book' //, ruby: 'erubis'
        attributes = [
                toc             : 'left',
                //      stylesheet: 'css/asciidoctor.css', linkcss : true, icons: 'font', // for unknown reason admonition-icons e.g. for WARNING boxes do not appear
                encoding        : 'utf-8',
                setanchors      : true,
                numbered        : true,
                linkattrs       : true,
                'allow-uri-read': ''
        ]

        sources {
            include 'index.asciidoc'
        }
        resources {
            from file('src/asciidoc')
        }
        requires 'asciidoctor-diagram'
    }

    defaultTasks 'asciidoctor'
}

When I have snippet in my asciidoc like this

[plantuml, target=test1, format=png]
....
@startuml
testdot
@enduml
....

I get the following error:

asciidoctor: WARNING: system-overview.asciidoc: line 4: invalid style for literal block: plantuml

My assumption is, that the plugin gets not applied in the subproject.

Can anyone assist how to apply the plugin in the subprojects as well?

Thanks!

robertpanzer commented 1 year ago

You might want to check in the repo asciidoctor/asciidoctor-gradle-plugin. If it also fails when converting a document from a local java program, or the distribution please reopen the ticket.