File tree 6 files changed +99
-2
lines changed
asciidoctorj-distribution/src/test 6 files changed +99
-2
lines changed Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change
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.
Original file line number Diff line number Diff line change
1
+ = Book Title
2
+ Author Name
3
+ :imagesdir: images
4
+
5
+ include::content-document.adoc[]
Original file line number Diff line number Diff line change
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
+
Original file line number Diff line number Diff line change 59
59
// jar versions
60
60
arquillianVersion = ' 1.6.0.Final'
61
61
arquillianSpockVersion = ' 1.0.0.CR1'
62
- asciidoctorjPdfVersion = ' 1.6.2 '
62
+ asciidoctorjPdfVersion = ' 2.3.7 '
63
63
asciidoctorjEpub3Version = ' 1.5.1'
64
- asciidoctorjDiagramVersion = ' 2.2.7'
64
+ asciidoctorjDiagramVersion = ' 2.2.7' // 2.2.8+ requires Java 11
65
65
asciidoctorjDiagramDitaaMiniVersion = ' 1.0.3'
66
66
asciidoctorjDiagramPlantumlVersion = ' 1.2023.5'
67
67
asciidoctorjRevealJsVersion = ' 4.1.0'
You can’t perform that action at this time.
0 commit comments