AsciidoctorJ post processor, that extracts ToC into separate file and optionally can inject content into rendered document. Can be used only for HTML backend, will fail if used with PDF.
It is targeted to inject front-matter
section suitable for the Hugo website generator.
Here's a simple usage example:
<build>
<plugins>
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
<version>${asciidoctor.maven.plugin.version}</version>
<dependencies>
<dependency>
<groupId>io.bootique.tools</groupId>
<artifactId>hugo-asciidoctorj-extension</artifactId>
<version>${hugo.asciidoctorj.extension.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>asciidoctor-html-hugo</id>
<phase>generate-resources</phase>
<goals>
<goal>process-asciidoc</goal>
</goals>
<configuration>
<doctype>book</doctype>
<backend>html5</backend>
<!-- ... -->
<extensions>
<extension>
<className>io.bootique.tools.asciidoctorj.HugoExtension</className>
</extension>
</extensions>
<attributes>
<!-- ... -->
</attributes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<!-- ... -->
</build>
Projects using this extension:
Extension controlled by attributes in *.adoc
file:
hugo-header
: header file name, if not set empty 'front-matter' will be usedhugo-font-awesome-icons
: convert icons to a FontAwesome compatible variant (true
/false
, default istrue
)hugo-multipage
: split document to a separate pages (true
/false
, default isfalse
)hugo-multipage-level
: nested section level that will be used for a single page content in a multipage documents (default is1
)hugo-multipage-header
: header file name to add to a multipage documents, index page will always usehugo-header
, if not set empty 'front-matter' will be usedhugo-multipage-ref
: reference prefix for a multipage navigation (could be something like/docs/1.x/
)
You could open an issue or a feature request via GitHub Issues
You need Java 8+ and Maven.
mvn release:prepare -Prelease
mvn release:perform -Prelease