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

Add Conversion of LICENSE.adoc to RTF Format #1056

Open
alfeilex opened this issue Feb 19, 2025 · 1 comment
Open

Add Conversion of LICENSE.adoc to RTF Format #1056

alfeilex opened this issue Feb 19, 2025 · 1 comment

Comments

@alfeilex
Copy link
Member

alfeilex commented Feb 19, 2025

The license file displayed in the MSI installation needs to be in RTF format see here . The license we use for that is located in documentation/LICENSE.adoc. There isn’t a direct conversion from .adoc to RTF, but there are solutions available online suggesting that it’s possible to convert .adoc to DocBook and then to RTF.

Here’s some relevant links:

Also we should have a look at the layout since the RTF seems to somehow mess up our table (it is also not possible to increase the size of the installer window or to scroll horizontally to read the entire license text):

Image

@alfeilex
Copy link
Member Author

I have already tried to use the asciidoctor-maven-plugin and docbkx-maven-plugin to create a pipeline. Finally, It worked out to convert LICENSE.adoc into Docbook with asciidoctor-maven-plugin and then into RTF with docbkx-maven-plugin. However, some elements, like the toc and links, do not map correctly, making the output look odd. it looks like, we need a special FO stylesheet for that or we should try openJade

snippet of documentation/pom.xml of my tested approach:

 <executions>
          <execution>
            <id>generate-doc</id>
            <phase>compile</phase>
            <goals>
              <goal>process-asciidoc</goal>
            </goals>
          </execution>
          <execution>
            <id>generate-docbook</id>
            <phase>compile</phase>
            <goals>
              <goal>process-asciidoc</goal>
            </goals>
            <!-- Is needed for the MSI installer .adoc->docbook->rtf -->
            <configuration>
              <sourceDocumentName>LICENSE.adoc</sourceDocumentName>
              <outputDirectory>${docgen.generated.docbooks}</outputDirectory>
              <backend>docbook</backend>
              <toc>no</toc>
              <attribute-missing>drop</attribute-missing>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>3.6.0</version>
        <executions>
        ...
      </plugin>
      <plugin>
        <groupId>com.agilejava.docbkx</groupId>
        <artifactId>docbkx-maven-plugin</artifactId>
        <version>2.0.14</version>
        <dependencies>
          <dependency>
            <groupId>org.docbook</groupId>
            <artifactId>docbook-xml</artifactId>
            <version>4.4</version>
            <type>pom</type>
            <scope>runtime</scope>
          </dependency>
          <dependency>
            <groupId>net.sf.offo</groupId>
            <artifactId>fop-hyph</artifactId>
            <version>2.0</version>
            <scope>runtime</scope>
          </dependency>
        </dependencies>
        <configuration>
          <sourceDirectory>${docgen.generated.docbooks}</sourceDirectory>
          <includes>LICENSE.xml</includes>
          <highlightSource>1</highlightSource>
        </configuration>
        <executions>
          <execution>
            <id>generate-rtf</id>
            <phase>process-classes</phase>
            <goals>
              <goal>generate-rtf</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant