Hello Stuart,
Le 15/01/2013 00:02, Stuart Rackham a écrit :
A work-around is to use the {@::} conditional attribute to substitute
one path if indir == docdir (i.e. is root document) or another path if
not (i.e. is an included sub-document) e.g.
image::{indir@{docdir}::doc/}picture.png[]
The src is picture.png if root document else doc/picture.png if included.
Thank you for this workaround, but I do not think that it helps a lot
(see below).
This is the expected behaviour:
>> lstree
/./main.asciidoc
./part1/chapter.asciidoc
./part1/images/photo1.png/
>>cat /./main.asciidoc/
:leveloffset: 1
:data-uri:
include::./part1/chapter.asciidoc[]
>>cat /./part1/chapter.asciidoc/
image::*./images/photo1.png[]*
Unfortunately not all backends interpret the imagepath in subdocuments
the same way. And it depends if :data-uri: is set or not.
I don't think that your workaround helps as long as the starting point
of imagepaths in subdocuments sometimes refer to the main document's
directory and sometimes to the subdocument's directory. For example if
:data-uri: is not set one has to write
image::*./chapter1/images/photo1.png[]*
in the subdocument instead.
Wouldn't it be the simplest and best solution to correct to code in
backends that imagepaths behave in a same consistent way as shown above,
whether :data-uri: is enabled or not?
Best regards
Jens
--
You received this message because you are subscribed to the Google Groups
"asciidoc" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/asciidoc?hl=en.