include macro changes working directory

38 views
Skip to first unread message

Warren Block

unread,
Sep 21, 2010, 11:33:49 PM9/21/10
to asci...@googlegroups.com
Using an include macro to include a link back to my document index works
fine:

include::../docs/links/index.txt

index.txt is just

http://www.wonkity.com/%7ewblock/docs/index.html[Links to all my articles.]

So far, so good. However, in documents that have images (this one is
pxe.txt):

include::../links/index.txt[]
image::./images/graphic.jpg["Sample graphic boot menu",align="center"]

/usr/local/bin/asciidoc -a data-uri -a icons -a iconsdir=/usr/local/etc/asciidoc/images/icons -d article -a stylesheet=~/docs/stylesheets/wb-html.css -a toc -a revdate="2010-09-21" -a year="2010" -a max-width=80em pxe.txt
cannot open /usr/home/wblock/docs/links/./images/graphic.jpg: No such file or directory
asciidoc: WARNING: pxe.txt: line 34: {sys:python -uc "import base64,sys; base64.encode(sys.stdin,sys.stdout)" < "/usr/home/wblock/docs/links/./images/graphic.jpg"}: non-zero exit status

Directory layout:
docs
links
index.txt
pxe
images
graphic.jpg
pxe.txt

The image link worked before adding the include macro.

Stuart Rackham

unread,
Sep 24, 2010, 6:43:28 PM9/24/10
to asci...@googlegroups.com
Hi Warren

Thanks for reporting this long standing bug. Happens because nested includes do
not restore the parent document 'infile' and 'indir' attributes.

I've committed a fix, give it a go and let us know if it works or not:
http://code.google.com/p/asciidoc/source/detail?r=7f9b4f8de2460be1cbb938a12f3ca7ce32f1baf7


Cheers, Stuart

>

Warren Block

unread,
Sep 24, 2010, 9:57:46 PM9/24/10
to asci...@googlegroups.com
On Sat, 25 Sep 2010, Stuart Rackham wrote:
>>
>> The image link worked before adding the include macro.
>
> Thanks for reporting this long standing bug. Happens because nested includes
> do not restore the parent document 'infile' and 'indir' attributes.
>
> I've committed a fix, give it a go and let us know if it works or not:
> http://code.google.com/p/asciidoc/source/detail?r=7f9b4f8de2460be1cbb938a12f3ca7ce32f1baf7

Yes--works great! Caveat: I couldn't quickly figure out how to get an
actual diff rather than a side-by-side full listing from the Google Code
interface, so I manually edited my asciidoc.py.

Thanks!

Reply all
Reply to author
Forward
0 new messages