-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1228 from abelsromero/update-distributions-depend…
…encies (v2.5.x) Update distributions dependencies
- Loading branch information
Showing
6 changed files
with
99 additions
and
2 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
...idoctorj-distribution/src/test/java/org/asciidoctor/WhenDocumentContainsDitaaDiagram.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package org.asciidoctor; | ||
|
||
|
||
import org.junit.Test; | ||
|
||
import java.io.File; | ||
|
||
import static org.hamcrest.MatcherAssert.assertThat; | ||
import static org.hamcrest.Matchers.is; | ||
|
||
|
||
public class WhenDocumentContainsDitaaDiagram { | ||
|
||
private Asciidoctor asciidoctor = Asciidoctor.Factory.create(); | ||
|
||
@Test | ||
public void png_should_be_rendered_for_diagram() { | ||
File sourceDir = new File("build/resources/test"); | ||
File inputFile = new File(sourceDir, "sample-with-diagram.adoc"); | ||
|
||
File outputDiagram = new File(sourceDir, "asciidoctor-diagram-process.png"); | ||
File outputDiagramCache = new File(sourceDir, ".asciidoctor/diagram/asciidoctor-diagram-process.png.cache"); | ||
|
||
asciidoctor.requireLibrary("asciidoctor-diagram"); | ||
asciidoctor.convertFile(inputFile, | ||
Options.builder() | ||
.backend("html5") | ||
.toFile(new File(sourceDir, "sample.html")) | ||
.build()); | ||
|
||
assertThat(outputDiagram.exists(), is(true)); | ||
assertThat(outputDiagramCache.exists(), is(true)); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
asciidoctorj-distribution/src/test/java/org/asciidoctor/WhenEpub3BackendIsUsed.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.asciidoctor; | ||
|
||
import org.junit.Test; | ||
|
||
import java.io.File; | ||
|
||
import static org.asciidoctor.OptionsBuilder.options; | ||
import static org.hamcrest.CoreMatchers.is; | ||
import static org.junit.Assert.assertThat; | ||
|
||
public class WhenEpub3BackendIsUsed { | ||
|
||
private Asciidoctor asciidoctor = Asciidoctor.Factory.create(); | ||
|
||
@Test | ||
public void epub3_should_be_rendered_for_epub3_backend() { | ||
File inputFile = new File("src/test/resources/epub/epub-index.adoc"); | ||
File outputDir = new File("build/test-output"); | ||
outputDir.mkdirs(); | ||
File outputFile = new File(outputDir, "epub-index.epub"); | ||
asciidoctor.convertFile(inputFile, options().safe(SafeMode.SAFE) | ||
.backend("epub3") | ||
.toDir(outputDir) | ||
.get()); | ||
assertThat(outputFile.exists(), is(true)); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
asciidoctorj-distribution/src/test/resources/epub/content-document.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
= Content Title | ||
Author Name | ||
|
||
[abstract] | ||
This is the actual content. | ||
|
||
== First Section | ||
|
||
And off we go. |
5 changes: 5 additions & 0 deletions
5
asciidoctorj-distribution/src/test/resources/epub/epub-index.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
= Book Title | ||
Author Name | ||
:imagesdir: images | ||
|
||
include::content-document.adoc[] |
22 changes: 22 additions & 0 deletions
22
asciidoctorj-distribution/src/test/resources/sample-with-diagram.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
= Document Title | ||
|
||
[ditaa,asciidoctor-diagram-process] | ||
.... | ||
+-------------+ | ||
| Asciidoctor |-------+ | ||
| diagram | | | ||
+-------------+ | PNG out | ||
^ | | ||
| ditaa in | | ||
| v | ||
+--------+ +--------+----+ /---------------\ | ||
| |---+ Asciidoctor +--->| | | ||
| Text | +-------------+ | Beautiful | | ||
|Document| | !magic! | | Output | | ||
| {d}| | | | | | ||
+---+----+ +-------------+ \---------------/ | ||
: ^ | ||
| Lots of work | | ||
+-----------------------------------+ | ||
.... | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters