asciidoctor / asciidoctor-gradle-plugin

A Gradle plugin that uses Asciidoctor via JRuby to process AsciiDoc source files within the project.
https://asciidoctor.github.io/asciidoctor-gradle-plugin/
Apache License 2.0
285 stars 120 forks source link

PlantUML image generation failed #634

Open darkmoon221 opened 2 years ago

darkmoon221 commented 2 years ago

I am trying to create an html page from a simple asciidoc document with an embedded Plantuml diagram with a predefined theme (see project.adoc)

The gradle plugin fails to generate the html page with the following error message:

Converting <xyz>\documentation\project.adoc
Jun 22, 2022 7:30:51 AM uri:classloader:/gems/asciidoctor-2.0.17/lib/asciidoctor/parser.rb build_block
SEVERE: project.adoc: line 8: Failed to generate image: PlantUML image generation failed: [From <input> (line 2) ]

@startuml               
!theme lightgray        
^^^^^                   
 Syntax Error?          

Using one of the following tools works as expected:

The error above only occurrs while using this plugin.

Processing the document without defining a theme works as expected

Maybe I am missing a specific setting ?

plugin verison:

id 'org.asciidoctor.jvm.convert' version '3.3.2'

gradle task:

asciidoctor {

//  attributes \
//    'plantuml-config': 'documentation/themes/plantuml.cfg'

  sourceDir file('documentation')
  sources {
    include 'project.adoc'
  }
  outputDir file('build/docs')

  asciidoctorj {
    version = '2.5.4'
    modules {
      diagram.use()
    }
  }

  logDocuments = true
}

project.adoc

= Header
:toc: left

== Section

[plantuml, puml, png]
....
!theme lightgray

left to right direction

class ROLES {
}

class USER {
}

ROLES  -->  USER  : "USER_ID:ID"
....
life888888 commented 1 year ago

My build.gradle

I change some asciidoctor, pdf, jruby version , and add diagram module.

plugins {
  id "org.asciidoctor.jvm.pdf" version "3.3.0"
  id "org.asciidoctor.jvm.gems" version "3.3.0"
}

apply plugin: "java"

version = "0.1.0-SNAPSHOT"

repositories {
    ruby.gems()
    mavenCentral()
}

dependencies {
  asciidoctorGems "rubygems:rouge:3.15.0"
}

asciidoctorPdf {
  dependsOn asciidoctorGemsPrepare

  baseDirFollowsSourceFile()

  asciidoctorj {
     modules {
       asciidoctorj {
         version "2.5.6"
        }
       pdf {
         version "2.3.0"
       }
       diagram {
         version "2.2.3"
       }
     }

    requires "rouge"

    sources { include "project.adoc" }

    attributes "build-gradle": file("build.gradle"),
        "jrubyVersion": "9.3.8.0",
        "showtitle": "true",
        "allow-uri-read": "true",
        "source-highlighter": "rouge",
        "icons": "font",
        "imagesdir": "images",
        "experimental": "true"
  }
}

// alias
task asciidoctor(dependsOn: asciidoctorPdf)

./gradlew asciidoctor

My PDF

project

My Asciidoctor Gradle Plugin Examples:

https://github.com/life888888/asciidoctor-pdf-cjk-ext-gradle-examples/tree/main/manual-example

use new asciidoctor , pdf, jruby version

ysb33r commented 1 year ago

Can you test with 4.0.0-alpha.1 and see if this is still a problem?