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

Documentation on how to convert adoc to adoc #952

Closed
dsyer opened this issue Oct 21, 2024 · 2 comments
Closed

Documentation on how to convert adoc to adoc #952

dsyer opened this issue Oct 21, 2024 · 2 comments
Labels

Comments

@dsyer
Copy link

dsyer commented Oct 21, 2024

asciidoctor/asciidoctor#1793 was closed when asciidoctor-reducer was released. The examples in the README help me to make progress on the command line with the gem, but I still don't know what to do with it as part of a Maven build. I want to merge some files into a README as part of the Maven build.

None of the https://github.com/asciidoctor/asciidoctor-maven-examples/ seem to help.

@abelsromero
Copy link
Member

asciidoctor-reducer does not include an Asciidoctor converter (for context: #618 (comment)), which is the API that the asciidoctor-maven-plugin consumes.
You can get this in maven with the exec goal of the gem-maven-plugin.

<?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>org.asciidoctor.maven</groupId>
    <artifactId>asciidoctor-reducer-as-cli</artifactId>
    <version>1.0.0-SNAPSHOT</version>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <jruby.version>9.4.6.0</jruby.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>rubygems</groupId>
            <artifactId>asciidoctor-reducer</artifactId>
            <version>1.0.6</version>
            <type>gem</type>
        </dependency>
    </dependencies>

    <build>
        <extensions>
            <extension>
                <groupId>org.jruby.maven</groupId>
                <artifactId>mavengem-wagon</artifactId>
                <version>2.0.2</version>
            </extension>
        </extensions>
        <plugins>
            <plugin>
                <groupId>org.jruby.maven</groupId>
                <artifactId>gem-maven-plugin</artifactId>
                <version>3.0.3</version>
                <configuration>
                    <jrubyVersion>${jruby.version}</jrubyVersion>
                    <gemHome>${project.build.directory}/gems</gemHome>
                    <gemPath>${project.build.directory}/gems</gemPath>
                </configuration>
                <executions>
                    <execution>
                        <id>install-gems</id>
                        <goals>
                            <goal>initialize</goal>
                            <goal>exec</goal>
                        </goals>
                        <phase>compile</phase>
                        <configuration>
                            <execArgs>${project.build.directory}/gems/bin/asciidoctor-reducer -o output.adoc ${basedir}/README.adoc</execArgs>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <repositories>
        <repository>
            <id>mavengems</id>
            <url>mavengem:https://rubygems.org</url>
        </repository>
    </repositories>

</project>

@abelsromero
Copy link
Member

Closing this issue as this is considered an answered question. If you need more help, feel free to address to the Zulip asciidoctorj channel, we try to keep questions there and leave repos for issues.

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

No branches or pull requests

2 participants