Adding image captions
See original GitHub issueI am looking for a way to add image captions to slides.
AFAIK, since alt text cannot be rendered, the best solution is to use html’s figure
and figcaption
tags as seen in this SO answer with demo, by doing so we can create a CSS rule in order to theme figure’s caption independently.
I have just discovered rst file format, but apparently .. figure:
is already accepted (https://thomas-cokelaer.info/tutorials/sphinx/rest_syntax.html#images-and-figures). I tried with that code in hovercraft and worked fine, but unfortunately the output is not what I expected to be and I cannot theme it as I would love.
This is my desired output:
<div class="step"...>
<figure>
<img src="image.jpg" alt="alt text" />
<figcaption>Image caption</figcaption>
</figure>
</div>
And this is hovercraft’s output (as you can see figure
and figcaption
are missing):
<div class="step"...>
<img src="image.jpg" alt="alt text" width="100%">
Image caption
</div>
Is there any way to modify the figure’s output to match the desired one?
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (11 by maintainers)
Top GitHub Comments
Yup, that’s it, glad to hear it worked.
Ok, I figured it out: maybe it’s not the best way to do it (I am pretty new to python and I am learning quite a lot from this project) but I managed to install it by executing
sudo python3 install setup.py
. After doing so, html is rendering as expected.