AsciidocFX icon indicating copy to clipboard operation
AsciidocFX copied to clipboard

Headless mode

Open hypery2k opened this issue 1 year ago • 5 comments

Is it possible to run AsciidocFx in headless mode, e.g. for CI Build of documents?

hypery2k avatar Mar 12 '23 18:03 hypery2k

Technically can be developed, but AsciidocFX has no such a feature yet.

rahmanusta avatar Mar 12 '23 21:03 rahmanusta

If your goal is to convert asciidoc-files to HTML, PDF, etc. AsciidocFX is not needed as there is already asciidoctor, which is a CLI tool, which does exactly that. If, by chance you are using Java/Maven, there is also a Maven-plugin. This combination allows it for example to generate Asciidoc from your codebase and include it in your technical documentation. This is e.g. done with this library (which uses Java, Spring, Gradle) spring-restdocs. (Actually due to this project I discovered Asciidoc some years ago, but I used it with Maven.)

Perhaps there are also plug-ins for your build tool?

gillesB avatar Mar 13 '23 07:03 gillesB

thanks for your reply. I already using the Maven Plugin, but cannot utilize some of the extensions of AsciidocFX, e.g. for diagrams

hypery2k avatar Mar 13 '23 07:03 hypery2k

I have not looked in the code, but wouldn't it be nicer if the custom processors would be extracted to an own library. Then they could be used with the Maven plugin. At least if I understand the extensions sections correctly.

On the other side, it might be that JavaFx makes the usage of this approach very hard to use?

https://docs.asciidoctor.org/maven-tools/latest/plugin/goals/process-asciidoc/#configuration

<plugin>
    ...
    <executions>
        <execution>
            <configuration>
                ...
                <extensions>
                    <extension>
                        <className>org.asciidoctor.maven.SomePreprocessor</className>
                    </extension>
                    <extension>
                        <className>org.asciidoctor.maven.SomeBlockProcessor</className>
                        <blockName>yell</blockName>
                    </extension>
                </extensions>
            </configuration>
        </execution>
    </executions>
    <dependencies>
        <dependency> 
            <groupId>org.asciidoctor.maven</groupId>
            <artifactId>my-asciidoctor-extensions</artifactId>
            <version>1.0.0</version>
        </dependency>
    </dependencies>
</plugin>

gillesB avatar Mar 14 '23 10:03 gillesB

thanks for your reply. I already using the Maven Plugin, but cannot utilize some of the extensions of AsciidocFX, e.g. for diagrams

https://github.com/asciidoctor/asciidoctor-maven-examples/tree/main/asciidoctor-diagram-example

life888888 avatar Oct 16 '23 05:10 life888888