audio_image
is a plugin that allows writers using gitbook to insert images
that play an audio file when clicked.
Add to book.json
: plugins: ["audio_image"]
audio_image
introduces a aimg
block with the following syntax:
{% aimg [key1=arg1[, key2=arg2[,..]]] %}imgfile,audiofile1[,audiofile2[,..]]{% endaimg %}
{% aimg %}img/img1.png,audio/img1.wav{% endaimg %}
Keyword arguments are translated to HTML
tags. Keyword arguments must start
with img
or audio
and will be added to the respective tags. This example
will show an image of a specific size and will show audio controls below the image. Note that
for non keyword arguments in HTML
you must use a keyword argument with an
empty value.
{% aimg imgwidth="50", imgheight="100", audiocontrols=""%}img/img1.png,audio/img1.wav{% endaimg %}
Different browsers support different audiofiles. So if you want to support all the browsers you can specify multiple files.
{% aimg %}img/img1.png,audio/img1.ogg,audio/img1.mp3{% endaimg %}
If you really want comma's in your filename you can escape them with a single backslash.
{% aimg %}img/img\,1.png,audio/img1.wav{% endaimg %}
Mart Lubbers ([email protected])
See LICENCE
file.