A way to set tooltips for image elements
I would like to use symbolic icons in documentation and use tooltips to explain what the symbols mean.
Concretely, I want something like this in the HTML output: <img title="This class is deprecated" src="icon-deprecated.svg" />
.
It's already possible to set alt
text, by doing this in the input:
<inlinemediaobject>
<imageobject>
<imagedata fileref="icon-deprecated.svg"/>
</imageobject>
<textobject>This class is deprecated</textobject>
</inlinemediaobject>
That sets the <img alt="">
attribute, but that's only used if the image can't be displayed for some connectivity or accessibility reason.
The code that generates <img>
tags is mkhtml2.py line 393.
I'm not sure how the input XML could specify the tooltip text. Maybe we could always use the given text for both alt
and title
attributes? Or maybe there's another Docbook tag we could use...?
Edited by Sam Thursfield