Skip to content

Commit

Permalink
Merge pull request #1228 from abelsromero/update-distributions-depend…
Browse files Browse the repository at this point in the history
…encies

(v2.5.x) Update distributions dependencies
  • Loading branch information
robertpanzer committed Jun 25, 2023
2 parents 4cc2e9b + c29279d commit 088e373
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 2 deletions.
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));
}
}
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));
}
}
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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
= Book Title
Author Name
:imagesdir: images

include::content-document.adoc[]
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 |
+-----------------------------------+
....

4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ ext {
// jar versions
arquillianVersion = '1.6.0.Final'
arquillianSpockVersion = '1.0.0.CR1'
asciidoctorjPdfVersion = '1.6.2'
asciidoctorjPdfVersion = '2.3.7'
asciidoctorjEpub3Version = '1.5.1'
asciidoctorjDiagramVersion = '2.2.7'
asciidoctorjDiagramVersion = '2.2.7' // 2.2.8+ requires Java 11
asciidoctorjDiagramDitaaMiniVersion = '1.0.3'
asciidoctorjDiagramPlantumlVersion = '1.2023.5'
asciidoctorjRevealJsVersion = '4.1.0'
Expand Down

0 comments on commit 088e373

Please sign in to comment.