Open Tabea4 opened 1 week ago
I cannot reproduce:
$ cat 534.adoc
ifndef::imagesdir[]
:imagesdir: presentation/images
endif::[]
image::TestImage1.png[]
include::inc.adoc[leveloffset=1]
$ cat inc.adoc
= Subdocument
ifndef::imagesdir[]
:imagesdir: images
endif::[]
image::TestImage2.png[]
$ asciidoctor-revealjs -v
Asciidoctor reveal.js 5.1.0 using Asciidoctor 2.0.20 [https://asciidoctor.org]
Runtime Environment (ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]) (lc:UTF-8 fs:UTF-8 in:UTF-8 ex:UTF-8)
$ asciidoctor-revealjs 534.adoc -s -o -
<div class="reveal">
<div class="slides">
<div class="imageblock">
<img src="presentation/images/TestImage1.png" alt="TestImage1">
</div>
<section id="_subdocument">
<h2>Subdocument</h2>
<div class="slide-content">
<div class="imageblock">
<img src="presentation/images/TestImage2.png" alt="TestImage2">
</div>
</div>
</section>
</div>
</div>
Maybe a compatibility issue with asciidoctor-diagram
. Could you please try without using -r asciidoctor-diagram
?
Hi @ggrossetie ,
Using it withou the -r asciidoctor-diagram
option did not fix the issue.
I realized that I missed the title in my example. I updated the example for the document-reveal.js
.
If you add a title, e.g. = Presentations
in your 534.adoc
file, could you try to reproduce the issue again?
Deleting the title, seems like a similar workaround as I described in the "Workaround 2" option.
Update:
It seems like the position of the title for the entry document (in the example document-reveal.js
) seems to play a role:
ifndef::imagesdir[]
:imagesdir: presentation/images
endif::[]
= Presentations
image::TestImage1.png[]
include::presentation/subdocument-revealjs.adoc[leveloffset=1]
=> Everything works properly ✅
= Presentations
ifndef::imagesdir[]
:imagesdir: presentation/images
endif::[]
image::TestImage1.png[]
include::presentation/subdocument-revealjs.adoc[leveloffset=1]
=> TestImage2 path is not resolved properly ❌
Hi all,
I encountered a strange behavior when trying to include images using the
imagesdir
attribute. The image directory is not prepended to the image path when the asciidoc file is included via another asciidoc file.Following minimal example illustrates the issue:
Version:
Command:
Example:
= Presentations
ifndef::imagesdir[] :imagesdir: presentation/images endif::[]
image::TestImage1.png[]
include::presentation/subdocument-revealjs.adoc[leveloffset=1]
= Subdocument
ifndef::imagesdir[] :imagesdir: images endif::[]
image::TestImage2.png[]
ifndef::imagesdir[] :imagesdir: images endif::[]
= Subdocument
[frame="none", grid="none"] |=== a| image::TestImage2.png[] |===
ifndef::imagesdir[] :imagesdir: images endif::[]
image::TestImage2.png[]
= Subdocument
:imagesdir: presentation/images
image::TestImage2.png[]