asciidoctor / asciidoctor-maven-plugin

A Maven plugin that uses Asciidoctor via JRuby to process AsciiDoc source files within the project.
http://asciidoctor.org
Apache License 2.0
317 stars 122 forks source link

How do you add attribute "compress" to maven-plugin #758

Closed crizzlybaer13 closed 7 months ago

crizzlybaer13 commented 7 months ago

Thank you for taking your time to talk with us!

What is this issue about?

Description

Hello everyone,

asciidoctor-pdf has an attribute "compress" which can be called via the commandline with -a compress.

How can I achieve the same effect for the maven-plugin? I thought it should work like this ( in attributes-section), but unfortunatley it has no effect:

`

     <plugin>
      <groupId>org.asciidoctor</groupId>
      <artifactId>asciidoctor-maven-plugin</artifactId>
      <version>1.5.8</version>
      <executions>
        <execution>
          <id>generate-pdf-doc</id>
          <phase>generate-resources</phase>
          <goals>
            <goal>process-asciidoc</goal>
          </goals>
          <configuration>
            <attributes>
              <compress/>
            </attributes>
            <requires>
              <require>asciidoctor-diagram</require>
            </requires>
            <backend>pdf</backend>
            <sourceHighlighter>coderay</sourceHighlighter>
            <headerFooter>true</headerFooter>
            <preserveDirectories>true</preserveDirectories>
          </configuration>
        </execution>
      </executions>
      <dependencies>
        <dependency>
          <groupId>org.asciidoctor</groupId>
          <artifactId>asciidoctorj-pdf</artifactId>
          <version>1.5.0-alpha.17</version>
          <scope>compile</scope>
        </dependency>
        <dependency>
          <groupId>org.jruby</groupId>
          <artifactId>jruby-complete</artifactId>
          <version>9.1.17.0</version>
          <scope>compile</scope>
        </dependency>
        <dependency>
          <groupId>org.asciidoctor</groupId>
          <artifactId>asciidoctorj</artifactId>
          <version>1.5.8.1</version>
          <scope>compile</scope>
        </dependency>
        <dependency>
          <groupId>org.asciidoctor</groupId>
          <artifactId>asciidoctorj-diagram</artifactId>
          <version>1.5.16</version>
          <scope>compile</scope>
        </dependency>
      </dependencies>
    </plugin>

`

Any help is appreciated.

Environment information

abelsromero commented 7 months ago

XML to attributes cannot be made 1-to-1, empty tag sets as value an empty string, to set null use <compress>false</.

But I am surprised the backend does differentiate, may I ask how to verify it's not working?

crizzlybaer13 commented 7 months ago

Hi, thanks for the quick answer. I tried to reproduce the error with an example-project and used a newer version of asciidoctor-maven-plugin and now it worked.

I updated my actual project too and it worked as expected.

Thanks for help. I close the issue.