restructuredtextpelican

Adding title attribute to an image in rst


Seems like restructured text markup is very limited when it comes to image options:

The following options are recognized:
alt : text
height : length
width : length or percentage of the current line width
scale : integer percentage (the "%" symbol is optional)
align : "top", "middle", "bottom", "left", "center", or "right"
target : text (URI or reference name)

Is it possible to set some custom attributes like title via reStructuredText markup?

e.g.

.. image:: foobar.jpg 
    :title: mouse over text, hi!

Would output:

<img src="foobar.jpg" title="mouse over text, hi!"></img>

Solution

  • According to docutils, the following options are recognized: alt, height, width, scale, align, target, class, and name. No title.

    Options include rewriting in the client with JavaScript or work with the docutils team to make a feature request and implement it.