confluence-publisher
confluence-publisher copied to clipboard
plantUML files in nested documents cannot be found
I have this in the maven plugin setting:
<asciidocRootFolder>doc</asciidocRootFolder>
If I create the following structure:
<root>
+- pom.xml
+- src
+- doc
+- top-level-page.adoc // top-level page AsciiDoc file
+- top-level-page // folder for sub-pages and resources of top-level page
+- sub-page-one.adoc // first sub page AsciiDoc file
+- plantuml.puml // plantUML file used in sub-page-one.adoc
My top-level-page.adoc contains a link::top-level-page/sub-page-one.adoc and I use a plantuml::plantuml.puml[] link in sub-page-one-doc Ik get an error about not able to find the plantuml file as it cannot find the plantuml.puml file as it searches it in root instead of root followed by the content of asciidocRootFolder.
What do I do wrong? Or do I misunderstand the way this plugin works? Can you provide a simple example in de codebase?
Hi @peetkes, thank you for using the Confluence Publisher. I tried to reproduce your issue, but without success. Would it be possible for you to share your stripped-down example?
Also, I don't yet understand how your link from the top-level page to the sub page is related to including the PlantUML diagram in the sub page (I anyway assume you are using link:top-level-page/sub-page-one.adoc[]
, not link::top-level-page/sub-page-one.adoc
)
I think I found a work-around. The issue is not in your plugin but in the asciidoc tool. When I preview in Visual Code the second link to the plantuml file will not resolve when you open the top-level-page.adoc but it does resolve when you open sub-page-one.adoc. The first plantuml construct works when you open either page.
Toplevel-page.adoc:
= Overzicht Processen binnen component Opera
:toc: left
:source-highlighter: coderay
:figure-caption: Figuur
:figure-number: 0
:keyword: opera, cds, lvbb
== Introduction
This is an introduction.
include::sub-folder/index.adoc[leveloffset=+1]
sub-page-one.adoc:
= Included doc
== Intro
This is the intro of the sub-folder document.
Find below an embedded plantUML diagram.
The location is relative to this doc.
This will work:
[plantuml, sample-diagram,svg]
----
include::asynchrone_validatie.puml[]
----
This won't work and give an error on publication:
failed to create confluence page for asciidoc content in '..../doc/index.adoc ': org.jruby.exceptions.SystemCallError: (ENOENT) No such file or directory - asciidoctor: FAILED: <stdin>: Failed to load AsciiDoc document - No such file or directory - ...../doc/asynchrone_validatie.puml
As can be seen form the error message it does not take the appropriate level into account when resolving the link.
plantuml::asynchrone_validatie.puml[]