I want to use some informative icons that depict specific meanings. Hover your mouse over an icon and you see a tooltip showing what it means. Allow non-graphical user agents (e.g. browsers that do not support CSS, text-to-speech devices) to read it too.
Consider you write a list
- Chicken sandwich
- Tofu sandwich - vegan
- Chicken salad
- House salad - vegan
and you want to change this as below, where means "vegan".
- Chicken sandwich
- Tofu sandwich -
- Chicken salad
- House salad -
One idea I come up with is to write
* Chicken sandwich
* Tofu sandwich - &&VEGAN&&
...
then replace the string &&VEGAN&&
with <span class="vegan">VEGAN</span>
,
Also add custom CSS snippets
span.vegan {
display: none;
}
span.vegan:hover {
visibility: visible;
/* some position settings for the tool tip go here */
}
span.vegan::before {
display: inline;
font-family: "Font Awesome";
content: "\f06c";
}
The string replacement can be done every time I perform make html
followed by a shell command
find /path/to/build/html/ -name *.html -exec \
sed -i 's/\&\&VEGAN\&\&/\<span class="vegan"\>VEGAN\<\/span\>/g' {} \;
Does Sphinx or Read the Docs already have this sort of feature?