asciidocfx / AsciidocFX

Asciidoc Editor and Toolchain written with JavaFX 21 (Build PDF, Epub, Mobi and HTML books, documents and slides)
http://www.asciidocfx.com/
Apache License 2.0
1.9k stars 299 forks source link

Headless mode #586

Open hypery2k opened 1 year ago

hypery2k commented 1 year ago

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

rahmanusta commented 1 year ago

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

gillesB commented 1 year ago

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?

hypery2k commented 1 year ago

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

gillesB commented 1 year ago

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>
life888888 commented 11 months ago

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