You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not sure if the following is a bug or a feature and if this is the right project to post this issue.
Anyhow I created a simple .adoc with a PlantUml diagram and I want to convert it to HTML.
# Foo
:imagesdir: images.Title (optional)[plantuml]--
abstract class AbstractList
abstract AbstractCollection
interface List
interface Collection
List <|-- AbstractList
Collection <|-- AbstractCollection
Collection <|- List
AbstractCollection <|- AbstractList
AbstractList <|-- ArrayList
class ArrayList {
Object[] elementData
size()
}
enum TimeUnit {
DAYS
HOURS
MINUTES
}
annotation SuppressWarnings
--
When converting the .adoc I expect that a .png will be created in the images-folder.
This folder should be a sibling of the actual document.
The following code does this as expected but only if doctor.convert(text, options); is called.
If I call Document doc = doctor.load(text, options); String converted = doc.convert(); the .png is created but in the wrong images-folder.
This images-folder is a child of my current working folder.
publicclassTest {
publicstaticvoidmain(String[] args) throwsIOException {
StringabsPath = "C:/Users/gilles.baatz/git/gilles/PlantumlTest/src/main/resources/foobar/test.adoc";
PathabsPathAdoc = Paths.get(absPath);
Stringtext = Files.readString(absPathAdoc);
Pathparent = absPathAdoc.getParent();
Pathimages = parent.resolve("images");
Files.createDirectories(images);
Files.walk(images)
.sorted(Comparator.reverseOrder())
.map(Path::toFile)
.forEach(File::delete);
Files.createDirectories(images);
Asciidoctordoctor = Asciidoctor.Factory.create();
doctor.requireLibrary("asciidoctor-diagram");
System.out.println("HTML creation");
Optionsoptions = Options.builder()
.backend("html5")
.baseDir(parent.toFile())
.safe(SafeMode.UNSAFE)
.sourcemap(true)
.headerFooter(false)
.build();
// Does not work as expected: images will be created at "C:/Users/gilles.baatz/git/gilles/PlantumlTest/images"System.out.println("load then convert");
Documentdoc = doctor.load(text, options);
Stringconverted = doc.convert();
Files.list(images).forEach(p -> System.out.println(p));
// no files printedSystem.out.println("only convert");
doctor.convert(text, options);
Files.list(images).forEach(p -> System.out.println(p));
// one file printed
}
}
The text was updated successfully, but these errors were encountered:
Hello,
I am not sure if the following is a bug or a feature and if this is the right project to post this issue.
Anyhow I created a simple .adoc with a PlantUml diagram and I want to convert it to HTML.
When converting the .adoc I expect that a .png will be created in the
images
-folder.This folder should be a sibling of the actual document.
The following code does this as expected but only if
doctor.convert(text, options);
is called.If I call
Document doc = doctor.load(text, options); String converted = doc.convert();
the .png is created but in the wrongimages
-folder.This
images
-folder is a child of my current working folder.The text was updated successfully, but these errors were encountered: