On 17 January 2013 18:55, gmail <[email protected]> wrote:
> Lex,
>
> technically you are right, :data-uri: and non :data-uri: cases have to
> treated
> internally differenty. But for the user this should be transparent and not
> influence how paths have to be defined in asciidoc files.
Hi Jens,
Doesn't work in all cases, asciidoc may not have an input file for the
path to be relative to, or an output file for that matter since input
can come from stdin and output go to stdout. So the links *must* be
specified as the user needs them to be in the final document. To use
data-uri in such a situation you would have to specify an absolute
path to the image file resulting in a totally non-portable document or
via {imagesdir} on the command line.
So there is a different case again (that I admit I hadn't thought
through before :). There is no way asciidoc can deduce the relative
link path if it doesn't know where the output file is.
Same thing can potentially apply if -o points to a path outside the
asciidoc tree.
Also consider making an asciidoc document in a development directory
whose HTML will live in www/document and links to images in
www/document/images. Those images don't even have to exist on my
development machine, only on the target machine. Again there is no
way Asciidoc can know this and compensate, the user has to tell it the
correct link path relative to the output file.
>
> The code you suggested as solution is good. But it should be part of the
> asciidoc-code and not the user input!
Asciidoc doesn't know anything about master documents and
sub-documents that might or might not be included. It has no idea
when it should or should not apply some offset to the link path, or
what that might be since there are many sensible directory trees as
you pointed out (and many more non-sensible ones :). Only the user
knows these things and what the values are for their particular case.
They have to give asciidoc some help. So there is no simple way of
building anything into Asciidoc.
>
> Yes, maybe the leading slash is not a good idea, what about "~" ?
> (cf. unix home).
You should not use anything that has a standard meaning in *ix or *ws
paths otherwise it is likely to be confusing. But as I said above
Asciidoc can't calculate it in some circumstances anyway. Since
whatever is built into Asciidoc needs to be universal, so far I don't
see any such method working. (and anyway defining imagesdir means the
image:: macros are even shorter :)
Cheers
Lex
--
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.