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

invalid style for listing block: plantuml #42

Open
smartrics opened this issue Dec 15, 2017 · 6 comments
Open

invalid style for listing block: plantuml #42

smartrics opened this issue Dec 15, 2017 · 6 comments

Comments

@smartrics
Copy link

Hello - I am struggling to see what's wrong with my gradle file.
It builds correctly but it fails to activate asciidoctor-diagram, causing - as such - the error in subject and no images embedded in the generated html file.

Any hint appreciated...

here follows the output of the build

./gradlew clean asciidoctor

> Task :jrubyPrepare
Successfully installed asciidoctor-diagram-1.5.6
Successfully installed asciidoctor-1.5.6.1
2 gems installed

> Task :asciidoctor
Converting /home/fabrizio/gitlab/ipt-analytics/bayawak/src/docs/test.adoc
asciidoctor: WARNING: test.adoc: line 6: invalid style for listing block: plantuml


BUILD SUCCESSFUL in 16s

This is my adoc file (test.adoc)

= Test

A PlantUML diagram

[plantuml, "diag", png]
----
@startuml

actor User

component Comp1
component Comp2

folder "System"

User --> System
System ..> Comp1
System ..> Comp2

@enduml
----

Here we are!

and finally this is my build.gradle

buildscript {
    repositories {
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath 'org.asciidoctor:asciidoctorj-diagram:1.5.4.1'
        classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.6'
    }
}

plugins {
    id "org.asciidoctor.convert" version "1.5.6"
    id 'com.github.jruby-gradle.base' version '1.4.0'
}
apply plugin: 'org.asciidoctor.convert'

repositories {
    mavenCentral()
    jcenter()
}

dependencies {
    gems 'rubygems:asciidoctor-diagram:1.5.6'
}

asciidoctorj {
    version = '1.5.6'
}

asciidoctor {
    sourceDir = file('src/docs')
    sources {
        include 'test.adoc'
    }
    outputDir = file('build/docs')
    logDocuments = true

    dependsOn jrubyPrepare
    requires = ['asciidoctor-diagram']
    gemPath = jrubyPrepare.outputDir

    attributes   \
            'build-gradle': file('build.gradle'),
            'source-highlighter': 'coderay',
            'imagesdir': 'images',
            'toc': 'left',
            'icons': 'font',
            'allow-uri-read': true,

            backends = ['html5']
}

wrapper {
    gradleVersion = '4.2'
}

@mojavelinux
Copy link
Member

Could this be related to asciidoctor/asciidoctor-gradle-plugin#222?

@smartrics
Copy link
Author

I have played around with the file - I notice that sometimes it works (*) straight after the build file is modified in certain parts like the dependencies order. It's as if some cached parts get in the way of loading the extension.
I haven't yet found a pattern though on how to make it work consistently

(*) as in, the extension is used and the plantuml diagram correctly generated.

@smartrics
Copy link
Author

FWIW the build file here https://github.com/asciidoctor/asciidoctor-gradle-examples/blob/master/asciidoc-diagram-to-html-example/build.gradle

produced

./gradlew asciidoctor
Download https://plugins.gradle.org/m2/org/asciidoctor/asciidoctor-gradle-plugin/1.5.3/asciidoctor-gradle-plugin-1.5.3.pom

> Task :jrubyPrepare
Successfully installed asciidoctor-diagram-1.5.4
1 gem installed

Download https://jcenter.bintray.com/org/asciidoctor/asciidoctorj-groovy-dsl/1.0.0.preview2/asciidoctorj-groovy-dsl-1.0.0.preview2.pom

> Task :asciidoctor
asciidoctor-diagram: ERROR: Failed to generate image: PlantUML image generation failed: Invalid path '/plantuml'

then any subsequent run

./gradlew clean asciidoctor

> Task :jrubyPrepare
Successfully installed asciidoctor-diagram-1.5.4
Successfully installed asciidoctor-1.5.6.1
2 gems installed

> Task :asciidoctor
asciidoctor-diagram: ERROR: Failed to generate image: can't modify frozen 


BUILD SUCCESSFUL in 19s
3 actionable tasks: 3 executed

@smartrics
Copy link
Author

gradle -version


Gradle 4.1

Build time: 2017-08-07 14:38:48 UTC
Revision: 941559e020f6c357ebb08d5c67acdb858a3defc2

Groovy: 2.4.11
Ant: Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM: 1.8.0_131 (Oracle Corporation 25.131-b11)
OS: Linux 3.10.0-514.21.2.el7.x86_64 amd64

@gavenkoa
Copy link

gavenkoa commented Sep 17, 2018

Hit this issue too and for me it is definitely asciidoctor/asciidoctor-gradle-plugin#222 as I can update everything (com.github.jruby-gradle.base and rubygems:asciidoctor-diagram) to latest version except org.asciidoctor.convert which is working with v1.5.3 and failing with v1.5.6-v1.5.8. It looks like there are no v1.5.4-v.1.5.5...

Sticking to v1.5.3 until asciidoctor/asciidoctor-gradle-plugin#222 is open.

I use automatic rebuild on detection of source files changes with gradle -t.

@cforce
Copy link

cforce commented Jan 21, 2022

Using Maven plugin and have the same Message.
[INFO] asciidoctor: DEBUG: sections\00-introduction.adoc: line 18: unknown style for listing block: plantuml
[INFO] asciidoctor: DEBUG: sections\50-runtime-view.adoc: line 33: unknown style for listing block: plantuml

Example for a plantuml diagram:

[plantuml, example-diagram, png]
----
class BlockProcessor
class DiagramBlock
class DitaaBlock
class PlantUmlBlock

BlockProcessor <|-- DiagramBlock
DiagramBlock <|-- DitaaBlock
DiagramBlock <|-- PlantUmlBlock
----

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

4 participants