Skip to content

Commit c29279d

Browse files
committed
Update distributions dependencies
* Bump asciidoctorj-pdf to 2.3.7 * Do NOT bump asciidoctorj-diagram since it's not Java8 compatible * Add dependabot to automate updates bumps of selected dependencies
1 parent 4cc2e9b commit c29279d

File tree

6 files changed

+99
-2
lines changed

6 files changed

+99
-2
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package org.asciidoctor;
2+
3+
4+
import org.junit.Test;
5+
6+
import java.io.File;
7+
8+
import static org.hamcrest.MatcherAssert.assertThat;
9+
import static org.hamcrest.Matchers.is;
10+
11+
12+
public class WhenDocumentContainsDitaaDiagram {
13+
14+
private Asciidoctor asciidoctor = Asciidoctor.Factory.create();
15+
16+
@Test
17+
public void png_should_be_rendered_for_diagram() {
18+
File sourceDir = new File("build/resources/test");
19+
File inputFile = new File(sourceDir, "sample-with-diagram.adoc");
20+
21+
File outputDiagram = new File(sourceDir, "asciidoctor-diagram-process.png");
22+
File outputDiagramCache = new File(sourceDir, ".asciidoctor/diagram/asciidoctor-diagram-process.png.cache");
23+
24+
asciidoctor.requireLibrary("asciidoctor-diagram");
25+
asciidoctor.convertFile(inputFile,
26+
Options.builder()
27+
.backend("html5")
28+
.toFile(new File(sourceDir, "sample.html"))
29+
.build());
30+
31+
assertThat(outputDiagram.exists(), is(true));
32+
assertThat(outputDiagramCache.exists(), is(true));
33+
}
34+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package org.asciidoctor;
2+
3+
import org.junit.Test;
4+
5+
import java.io.File;
6+
7+
import static org.asciidoctor.OptionsBuilder.options;
8+
import static org.hamcrest.CoreMatchers.is;
9+
import static org.junit.Assert.assertThat;
10+
11+
public class WhenEpub3BackendIsUsed {
12+
13+
private Asciidoctor asciidoctor = Asciidoctor.Factory.create();
14+
15+
@Test
16+
public void epub3_should_be_rendered_for_epub3_backend() {
17+
File inputFile = new File("src/test/resources/epub/epub-index.adoc");
18+
File outputDir = new File("build/test-output");
19+
outputDir.mkdirs();
20+
File outputFile = new File(outputDir, "epub-index.epub");
21+
asciidoctor.convertFile(inputFile, options().safe(SafeMode.SAFE)
22+
.backend("epub3")
23+
.toDir(outputDir)
24+
.get());
25+
assertThat(outputFile.exists(), is(true));
26+
}
27+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
= Content Title
2+
Author Name
3+
4+
[abstract]
5+
This is the actual content.
6+
7+
== First Section
8+
9+
And off we go.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
= Book Title
2+
Author Name
3+
:imagesdir: images
4+
5+
include::content-document.adoc[]
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
= Document Title
2+
3+
[ditaa,asciidoctor-diagram-process]
4+
....
5+
+-------------+
6+
| Asciidoctor |-------+
7+
| diagram | |
8+
+-------------+ | PNG out
9+
^ |
10+
| ditaa in |
11+
| v
12+
+--------+ +--------+----+ /---------------\
13+
| |---+ Asciidoctor +--->| |
14+
| Text | +-------------+ | Beautiful |
15+
|Document| | !magic! | | Output |
16+
| {d}| | | | |
17+
+---+----+ +-------------+ \---------------/
18+
: ^
19+
| Lots of work |
20+
+-----------------------------------+
21+
....
22+

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ ext {
5959
// jar versions
6060
arquillianVersion = '1.6.0.Final'
6161
arquillianSpockVersion = '1.0.0.CR1'
62-
asciidoctorjPdfVersion = '1.6.2'
62+
asciidoctorjPdfVersion = '2.3.7'
6363
asciidoctorjEpub3Version = '1.5.1'
64-
asciidoctorjDiagramVersion = '2.2.7'
64+
asciidoctorjDiagramVersion = '2.2.7' // 2.2.8+ requires Java 11
6565
asciidoctorjDiagramDitaaMiniVersion = '1.0.3'
6666
asciidoctorjDiagramPlantumlVersion = '1.2023.5'
6767
asciidoctorjRevealJsVersion = '4.1.0'

0 commit comments

Comments
 (0)