Skip to content

Commit

Permalink
closes asciidoctor#188: sets html5 as default backend
Browse files Browse the repository at this point in the history
  • Loading branch information
abelsromero committed May 30, 2020
1 parent afdfc3c commit 6bf7890
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/it/uses-html5-as-default-backend/invoker.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
invoker.goals=clean asciidoctor:process-asciidoc
25 changes: 25 additions & 0 deletions src/it/uses-html5-as-default-backend/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.asciidoctor</groupId>
<artifactId>test</artifactId>
<version>1.0-SNAPSHOT</version>

<name>Converts Asciidoctor Article to Html</name>
<description>Runs asciidoctor-maven-plugin:process-asciidoc</description>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
<version>@project.version@</version>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Document Title
==============
Doc Writer <thedoc@asciidoctor.org>
:idprefix: id_

Preamble paragraph.

NOTE: This is test, only a test.

== Section A

*Section A* paragraph.

=== Section A Subsection

*Section A* 'subsection' paragraph.

== Section B

*Section B* paragraph.

.Section B list
* Item 1
* Item 2
* Item 3
16 changes: 16 additions & 0 deletions src/it/uses-html5-as-default-backend/validate.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
final File outputDir = new File(basedir, "target/generated-docs");

final def expectedFiles = ["sample.html"]

expectedFiles.each { it ->
File file = new File(outputDir, it);
System.out.println("Checking for existence of " + file)
if (!file.exists() || !file.isFile()) {
throw new Exception("Missing file " + file)
}
if (!file.text.startsWith("<!DOCTYPE html>")) {
throw new Exception("Expected file does not contain HTML: " + file)
}
}

return true
2 changes: 1 addition & 1 deletion src/main/java/org/asciidoctor/maven/AsciidoctorMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public class AsciidoctorMojo extends AbstractMojo {
@Parameter(property = AsciidoctorMaven.PREFIX + Options.ATTRIBUTES, required = false)
protected String attributesChain = "";

@Parameter(property = AsciidoctorMaven.PREFIX + Options.BACKEND, defaultValue = "docbook", required = true)
@Parameter(property = AsciidoctorMaven.PREFIX + Options.BACKEND, defaultValue = "html5", required = true)
protected String backend = "";

@Parameter(property = AsciidoctorMaven.PREFIX + Options.DOCTYPE, required = false)
Expand Down

0 comments on commit 6bf7890

Please sign in to comment.