Open thedrow opened 4 years ago
Do you just wish the lightbox2 css applied to images inserted/loaded through the
figure: whatever.jpg
directive?
Yes.
Great idea, I could easily have wished for that myself in the past. Feel free to implement it and make a PR, otherwise I'll have a look at it a few weeks from now.
How time flies when you have a baby and a 3-year-old! Please accept my apologies for not attending to the PRs and issues in a timely fashion. I'll attend to them at the latest on August 29th and 30th (I have another project with deadline on August 28th).
@jonascj I think the main concern of adding lightbox to figures is that lightbox label does not have a translatable text, i.e. if you add a caption to your LB image, you won't be able to translate the phrase
Any news?
@SilverRainZ No, I haven't looked into it yet. You are welcome to submit a PR if you can find a way to implement it. See also #20 :-)
Some findings and/or realizations which might be worth remembering, going forward with this:
<figure class="align-default" id="id1">
<span id="some-fig-label"></span>
<img alt="_images/python.png" src="_images/python.png" />
<figcaption>
<p>
<span class="caption-number">Fig. 1 </span>
<span class="caption-text">The Python logo.</span>
<a class="headerlink" href="#id 1" title="Permalink to this image">¶</a>
</p>
</figcaption>
</figure>
All that is needed to turn this into a lightbox2 image is to wrap the <img>
tag in <a data-lightbox="[unique id]" data-title="The Python logo." href="_images/python.png">
.
.. image::
nor .. thumbnail::
directives can have a label and be referenced. The reason being neither have a title or caption associated with them. So if referenced what should the reference show? Fig. <num>
is not meaningful since it has no number. The Python logo
is not meaningful either since it has no title.At present .. thumbnail::
can not be referenced in any way (afaik). Adding an explicit target above a thumbnail directive will result in a warning, i.e. this will not work with thumbnails (but it works with .. image::
):
.. _target whatever:
.. thumbnail:: whatever.jpg
An image of whatever can be seen here: :ref:`Whatever <target whatever>`.
.. thumbnail::
directive numbered so it can be referenced, 2) Wrap the .. figure::
directive's <img>
tag in a lightbox link (see above).I don't see why thumbnails shouldn't have a unique id. It can be a random id if it is just for this purpose.
.. thumbnail::
directives, explicit targets do not work (see above or #27). That is a bug imo and we should at least fix that.At the same time I think we should make the .. thumbnail::
directive behave like .. figure::
, if numfig = True
thumbnails should be numbered just as figures (maybe with a sphinxcontrib.images configuration option to turn on/off this feature). I suppose it could be done two ways: 1) Utilize the figure directive when producing thumbnails, 2) create/register a counter with the .. thumbnail::
directive.
Can we add support for figure directives as well as image directives?