Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using an image results in an error #8

Closed
pcn opened this issue Jul 1, 2014 · 6 comments
Closed

Using an image results in an error #8

pcn opened this issue Jul 1, 2014 · 6 comments
Assignees
Milestone

Comments

@pcn
Copy link

pcn commented Jul 1, 2014

I'm trying to put an image into a document. Using this syntax:

.Good Luck!
image:graphics/Horseshoe.jpg[
"Lucky Horseshoe", width=128,
link="graphics/Horseshoe.jpg"]

I get the following error:

~/dvcs/github/asciidoctor-pdf/bin/asciidoctor-pdf README.adoc
asciidoctor: WARNING: gem 'thread_safe' is not installed. This gem recommended when using custom backend templates.
Failed to parse formatted text: <span class="image"><a class="image" href="graphics/Horseshoe.jpg"><img src="graphics/Horseshoe.jpg" alt="Lucky Horseshoe" width="128"></a></span>

and produces a pdf document with the error text embedded in it. I'm technically shallow with how asciidoctor-pdf and its rendering process works, so all I can do is compare it to rendering html via asciidoc, and the github adoc renderer. Both of them seem to work with this example.

@pcn
Copy link
Author

pcn commented Jul 1, 2014

I'm using f9dbca4

@mojavelinux
Copy link
Member

That's correct, Asciidoctor PDF doesn't yet support inline images (reported as #9). Prawn doesn't have an easy way to place images inline, so I'm still sorting out the best way to handle them.

In the meantime, you can use a block-level image. Just use two colons instead of one.

.Good Luck!
image::graphics/Horseshoe.jpg[
"Lucky Horseshoe", width=128,
link="graphics/Horseshoe.jpg"]

@mojavelinux mojavelinux added this to the support milestone Jul 1, 2014
@mojavelinux mojavelinux self-assigned this Jul 1, 2014
@mojavelinux
Copy link
Member

Do you agree that the scope of this issue has been captured in #9?

@pcn
Copy link
Author

pcn commented Jul 1, 2014

Sure.

@pcn pcn closed this as completed Jul 1, 2014
@pcn
Copy link
Author

pcn commented Jul 1, 2014

N.B.: The github asciidoc renderer doesn't know what to do with that syntax: https://gist.github.com/pcn/50bed8a876e8ef1f6043.

@mojavelinux
Copy link
Member

That's because a block macro must be on one line only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants