Using images in attributes

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Using images in attributes

m4rt1n
I want to render a table with some check and X marks as SVG images. Ideally, the images would be defined in an attribute so as to not clutter the table, something like this:
:YES: image::../images/tick.svg[]
:NO: image::../images/cross.svg[]

[options="header", cols="a"]
|=================
| Color | Red | Blue | Yellow
| Blue |{NO} | {YES} | {NO}
|=================
Unfortunately, when this renders, it shows the string value of the attributes rather than interpreting it as an image. Is it possible to use attributes with markup or is it a simple string replace?
Ted
Reply | Threaded
Open this post in threaded view
|

Re: Using images in attributes

Ted
I got the same result. Use the inline image
image:
 instead of the block image
image::

Try this.

= Using images in attributes
:YES: image:../images/tick.svg[]
:NO: image:../images/cross.svg[]


== Table 

[options="header"]
|===
| Color | Red | Blue | Yellow
| Blue |{NO} | {YES} | {NO}
|===

The AsciiDoc cols="a" caused each table cell to render as a row, so I removed it from the table options.
- Ted @TedAtCIS
Reply | Threaded
Open this post in threaded view
|

Re: Using images in attributes

m4rt1n
Brilliant, works like a charm. Thank you, Ted!