asciidoctor / asciidoctor-diagram

:left_right_arrow: Asciidoctor diagram extension, with support for AsciiToSVG, BlockDiag (BlockDiag, SeqDiag, ActDiag, NwDiag), Ditaa, Erd, GraphViz, Mermaid, Msc, PlantUML, Shaape, SvgBob, Syntrax, UMLet, Vega, Vega-Lite and WaveDrom.
http://asciidoctor.org
MIT License
439 stars 107 forks source link

Unknown style for open block: mermaid #461

Closed amusarra closed 5 months ago

amusarra commented 5 months ago

Hi. Following your examples, I created a Maven project to generate a PDF document from an asciidoc source. The source document contains Mermaid digraphs. When I run the process-asciidoc goal, I get the error in question.

...
[ERROR] asciidoctor: DEBUG: source-doc.adoc: line 130: unknown style for listing block: mermaid
[ERROR] asciidoctor: DEBUG: source-doc.adoc: line 213: unknown style for open block: mermaid
...

Followed by a Mermaid block which causes problems even though it shouldn't since it is syntactically correct and the IntellijIDEA plugin displays it correctly.

[mermaid]
----
sequenceDiagram
    autonumber
    Producer ->> Producer: Generate Message/Event
    Producer -->> Event Bus: Publish Message/Event (async)
    Event Bus -->> Consumer: Forward Message/Event (async)
    Consumer ->> Consumer: Process Message/Event

 Note over Producer,Consumer: A typical interaction
----
image

Below is the pom.xml file used.

<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>it.dontesta.eventbus.docs</groupId>
    <artifactId>eventbus-logging-filter-jaxrs-docs</artifactId>
    <version>1.0.7-RC1</version>

    <name>eventbus-logging-filter-jaxrs-docs</name>
    <url>http://www.example.com</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <asciidoctor.maven.plugin.version>3.0.0</asciidoctor.maven.plugin.version>
        <asciidoctorj.pdf.version>2.3.15</asciidoctorj.pdf.version>
        <asciidoctorj.version>2.5.12</asciidoctorj.version>
        <asciidoctorj.diagram.version>2.3.0</asciidoctorj.diagram.version>
        <asciidoctorj.diagram-plantuml.version>1.2024.3</asciidoctorj.diagram-plantuml.version>
        <asciidoctorj.diagram-ditaamini.version>1.0.3</asciidoctorj.diagram-ditaamini.version>
        <jruby.version>9.4.6.0</jruby.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <defaultGoal>process-resources</defaultGoal>
        <plugins>
            <plugin>
                <groupId>org.asciidoctor</groupId>
                <artifactId>asciidoctor-maven-plugin</artifactId>
                <version>${asciidoctor.maven.plugin.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>org.asciidoctor</groupId>
                        <artifactId>asciidoctorj-pdf</artifactId>
                        <version>${asciidoctorj.pdf.version}</version>
                    </dependency>
                    <!-- Comment this section to use the default jruby artifact provided by the plugin -->
                    <dependency>
                        <groupId>org.jruby</groupId>
                        <artifactId>jruby</artifactId>
                        <version>${jruby.version}</version>
                    </dependency>
                    <!-- Comment this section to use the default AsciidoctorJ artifact provided by the plugin -->
                    <dependency>
                        <groupId>org.asciidoctor</groupId>
                        <artifactId>asciidoctorj</artifactId>
                        <version>${asciidoctorj.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.asciidoctor</groupId>
                        <artifactId>asciidoctorj-diagram</artifactId>
                        <version>${asciidoctorj.diagram.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.asciidoctor</groupId>
                        <artifactId>asciidoctorj-diagram-plantuml</artifactId>
                        <version>${asciidoctorj.diagram-plantuml.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.asciidoctor</groupId>
                        <artifactId>asciidoctorj-diagram-ditaamini</artifactId>
                        <version>${asciidoctorj.diagram-ditaamini.version}</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <sourceDirectory>src/main/docs/asciidoc</sourceDirectory>
                    <enableVerbose>true</enableVerbose>
                    <logHandler>
                        <outputToConsole>true</outputToConsole>
                        <failIf>
                            <severity>DEBUG</severity>
                        </failIf>
                    </logHandler>
                    <!-- Attributes common to all output formats -->
                    <attributes>
                        <attribute-missing>warn</attribute-missing>
                        <allow-uri-read>true</allow-uri-read>
                        <source-highlighter>rouge</source-highlighter>
                        <imagesdir>../resources/images</imagesdir>
                        <themesdir>../resources/themes</themesdir>
                        <revnumber>${project.version}</revnumber>
                        <revdate>${maven.build.timestamp}</revdate>
                        <revremark>Digital Version</revremark>
                        <organization>${project.organization.name}</organization>
                    </attributes>
                </configuration>
                <executions>
                    <execution>
                        <id>generate-pdf-doc</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>process-asciidoc</goal>
                        </goals>
                        <configuration>
                            <backend>pdf</backend>
                            <attributes>
                                <source-highlighter>rouge</source-highlighter>
                                <pdf-theme>basic</pdf-theme>
                                <pdf-themesdir>../resources/themes</pdf-themesdir>
                                <icons>font</icons>
                                <pagenums/>
                                <toc/>
                                <idprefix/>
                                <idseparator>-</idseparator>
                            </attributes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

The mmdc is installed by the command npm install -g @mermaid-js/mermaid-cli and available on $PATH. The version of the mmdc -> 10.8.0.

What's the problem?

pepijnve commented 5 months ago

This looks like an asciidoctorj usage question. Might be best to ask the question to the authors of that project.

amusarra commented 5 months ago

This looks like an asciidoctorj usage question. Might be best to ask the question to the authors of that project.

Thanks for your quick response. Close this and open an issue to other projects.

mojavelinux commented 5 months ago

Usage questions should be directed to the project chat at https://chat.asciidoctor.org, not the issue tracker.