Skip to content

Commit

Permalink
[fj-doc-maven-plugin] support for asciidoc doc handler (fj-doc-versio…
Browse files Browse the repository at this point in the history
…n 8.8.7+)
  • Loading branch information
fugerit79 committed Oct 16, 2024
1 parent fdb066a commit 2d17400
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- [fj-doc-maven-plugin] support for asciidoc doc handler (fj-doc-version 8.8.7+)
- [fj-doc-maven-plugin] updated readme information for quarkus-3 flavour
- [fj-doc-guide] added pdf documentation
- [fj-doc-playground-quarkus] fj-doc-ext-kotlin-version set to 0.4.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,8 @@ public String getArtifactIdAsClassName() {
return toClassName( res, "\\." );
}

public boolean isAsciidocFreemarkerHandlerAvailable() {
return VersionCheck.isMajorThan( VenusContext.VERSION_ASCIIDOC_FREEMARKER_HANDLER, this.getVersion() );
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
@ToString
public class VenusContext {

public static final String VERSION_ASCIIDOC_FREEMARKER_HANDLER = "8.8.6";

public static final String VERSION_NA_VERIFY_PLUGIN = "8.7.2";

public static final String VERSION_NA_FULL_PROCESS = "8.6.2";
Expand Down Expand Up @@ -122,6 +124,10 @@ public boolean isVerifyPluginNotAvailable() {
return VersionCheck.isMajorThan( VERSION_NA_VERIFY_PLUGIN, this.getVersion() );
}

public boolean isAsciidocFreemarkerHandlerAvailable() {
return VersionCheck.isMajorThan( VERSION_ASCIIDOC_FREEMARKER_HANDLER, this.getVersion() );
}

public boolean isPreVersion862() {
return VersionCheck.isMajorThan( VERSION_NA_FULL_PROCESS, this.getVersion() );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ public class DocController {
<@fhm.createMicronautPath context=context outputMime="text/markdown" outputExtension="md" outputDescription="Markdown"/>

<@fhm.createMicronautPath context=context outputMime="text/html" outputExtension="html" outputDescription="HTML"/>


<#if context.asciidocFreemarkerHandlerAvailable>
<@fhm.createMicronautPath context=context outputMime="text/asciidoc" outputExtension="adoc" outputDescription="AsciiDoc"/>
</#if>

<#if context.modules?seq_contains("fj-doc-mod-fop")>
<@fhm.createMicronautPath context=context outputMime="application/pdf" outputExtension="pdf" outputDescription="PDF"/>
</#if>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ public class DocResource {

<@fhm.createQuarkusPath context=context outputMime="text/html" outputExtension="html" outputDescription="HTML"/>

<#if context.asciidocFreemarkerHandlerAvailable>
<@fhm.createQuarkusPath context=context outputMime="text/asciidoc" outputExtension="adoc" outputDescription="AsciiDoc"/>
</#if>

<#if context.modules?seq_contains("fj-doc-mod-fop")>
<@fhm.createQuarkusPath context=context outputMime="application/pdf" outputExtension="pdf" outputDescription="PDF"/>
</#if>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ public class DocResource {

<@fhm.createQuarkusPath context=context outputMime="text/html" outputExtension="html" outputDescription="HTML"/>

<#if context.asciidocFreemarkerHandlerAvailable>
<@fhm.createQuarkusPath context=context outputMime="text/asciidoc" outputExtension="adoc" outputDescription="AsciiDoc"/>
</#if>

<#if context.modules?seq_contains("fj-doc-mod-fop")>
<@fhm.createQuarkusPath context=context outputMime="application/pdf" outputExtension="pdf" outputDescription="PDF"/>
</#if>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ class DocResourceTest {
given().when().get("/doc/example.html").then().statusCode(200);
}

<#if context.asciidocFreemarkerHandlerAvailable>
@Test
void testAsciiDoc() {
given().when().get("/doc/example.adoc").then().statusCode(200);
}
</#if>

<#if context.modules?seq_contains("fj-doc-mod-fop")>
@Test
void testPdf() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ public class DocResource {

<@fhm.createQuarkusPath context=context outputMime="text/html" outputExtension="html" outputDescription="HTML"/>

<#if context.asciidocFreemarkerHandlerAvailable>
<@fhm.createQuarkusPath context=context outputMime="text/asciidoc" outputExtension="adoc" outputDescription="AsciiDoc"/>
</#if>

<#if context.modules?seq_contains("fj-doc-mod-fop")>
<@fhm.createQuarkusPath context=context outputMime="application/pdf" outputExtension="pdf" outputDescription="PDF"/>
</#if>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ class DocResourceTest {
given().when().get("/doc/example.html").then().statusCode(200);
}

<#if context.asciidocFreemarkerHandlerAvailable>
@Test
void testAsciiDoc() {
given().when().get("/doc/example.adoc").then().statusCode(200);
}
</#if>

<#if context.modules?seq_contains("fj-doc-mod-fop")>
@Test
void testPdf() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ public class DocController {
<@fhm.createSpringBootPath context=context outputMime="text/markdown" outputExtension="md" outputDescription="Markdown"/>

<@fhm.createSpringBootPath context=context outputMime="text/html" outputExtension="html" outputDescription="HTML"/>


<#if context.asciidocFreemarkerHandlerAvailable>
<@fhm.createSpringBootPath context=context outputMime="text/asciidoc" outputExtension="adoc" outputDescription="AsciiDoc"/>
</#if>

<#if context.modules?seq_contains("fj-doc-mod-fop")>
<@fhm.createSpringBootPath context=context outputMime="application/pdf" outputExtension="pdf" outputDescription="PDF"/>
</#if>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
<docHandler id="html-fm" info="html" type="org.fugerit.java.doc.freemarker.html.FreeMarkerHtmlTypeHandlerEscapeUTF8" />
<!-- Type handler for html using freemarker (fragment version, only generates body content no html or head part -->
<docHandler id="html-fragment-fm" info="fhtml" type="org.fugerit.java.doc.freemarker.html.FreeMarkerHtmlFragmentTypeHandlerEscapeUTF8" />
<#if context.asciidocFreemarkerHandlerAvailable>
<!-- type handler for asciidoc using freemarker -->
<docHandler id="asciidoc-fm" info="adoc" type="org.fugerit.java.doc.freemarker.asciidoc.FreeMarkerAsciidocTypeHandlerUTF8" />
</#if>
<#if context.modules?seq_contains("fj-doc-mod-fop")>
<!-- Type handler generating xls:fo style sheet -->
<docHandler id="fo-fop" info="fo" type="org.fugerit.java.doc.mod.fop.FreeMarkerFopTypeHandlerUTF8" />
Expand Down

0 comments on commit 2d17400

Please sign in to comment.