asciidoctor / asciidoctorj-pdf

AsciidoctorJ PDF bundles the Asciidoctor PDF RubyGem (asciidoctor-pdf) so it can be loaded into the JVM using JRuby.
Apache License 2.0
36 stars 17 forks source link

asciidoctorj-pdf does not respect `preserveDirectories` #19

Closed hupfdule closed 5 years ago

hupfdule commented 5 years ago

The asciidoctorj-option preserveDirectories is ignored by asciidoctorj-pdf. I have a document with images that I want to convert to HTML and PDF with the following pom-snippet:

 <plugin>
    <groupId>org.asciidoctor</groupId>
    <artifactId>asciidoctor-maven-plugin</artifactId>
    <version>1.5.6</version>
    <dependencies>
      <dependency>
        <groupId>org.asciidoctor</groupId>
        <artifactId>asciidoctorj-pdf</artifactId>
        <version>1.5.0-alpha.16</version>
      </dependency>
    </dependencies>
    <configuration>
      <sourceDirectory>${basedir}/src/doc/</sourceDirectory>
      <backend>xhtml5</backend>
      <sourceHighlighter>prettify</sourceHighlighter>
      <preserveDirectories>true</preserveDirectories>
      <attributes>
        <sectnums>true</sectnums>
        <toc>left</toc>
        <toclevels>3</toclevels>
        <imagesdir>.</imagesdir>
        <icons>font</icons>
      </attributes>
    </configuration>
    <executions>
      <execution>
        <id>manual-html</id>
        <phase>generate-resources</phase>
        <goals>
          <goal>process-asciidoc</goal>
        </goals>
      </execution>
      <execution>
        <id>manual-pdf</id>
        <phase>generate-resources</phase>
        <goals>
          <goal>process-asciidoc</goal>
        </goals>
        <configuration>
          <backend>pdf</backend>
          <sourceHighlighter>coderay</sourceHighlighter>
        </configuration>
      </execution>
    </executions>
  </plugin>

The document has the following structure:

 src/doc/                                                                                                                                                          
└── my-manual
    ├── my-manual.adoc
    └── screenshots
        ├── screenshot1.png
        ├── screenshot2.png
        ├── screenshot3.png

When generating the PDF asciidoctorj-pdf tries to load the images from src/doc/screenshots even though I specified the preserveDirectories option that correctly behaves when generating the HTML output.

robertpanzer commented 5 years ago

asciidoctorj-pdf is only a repackaging of asciidoctor-pdf. A better place for this issue would be https://github.com/asciidoctor/asciidoctor-pdf. Could you please open the issue for this repo?

mojavelinux commented 5 years ago

I don't even think there is a correlation between these two things. preserveDirectories is something the Maven plugin is handling. So if there's an issue, it's with the Maven plugin.

Since it's not relevant to this package, I'm going to close this issue.