RestructedText - 向链接添加标题属性
我正在尝试在我的网站上使用从 reStructuredText 生成的 jQuery lightBox 实现。 lightBox 将图像周围的链接标题作为 lightBox 显示中图像的标题。
但是,我似乎无法在 reStructuredText 中找到在链接上提供标题属性的方法 - 有人知道这样做的方法吗?我的图像定义如下:
.. image:: image001.thumb.jpg
:alt: Some alt text here
:target: image001.jpg
因此我可以添加 alt
属性,但不能添加标题。一种可能的替代方案可能是使用目标作为参考,如下所示:
.. image:: image001.thumb.jpg
:alt: Some alt text here
:target: image1_
.. _image1: image001.jpg
在后一种情况下,我不确定如何向底部定义的链接添加属性(如果可能的话)。
I am trying to use a jQuery lightBox implementation on my website that is generated from reStructuredText. The lightBox takes the title of the link around the images as the caption of the image in the lightBox display.
However, I can't seem to find a way in reStructuredText of providing a title attribute on a link - does anyone know of a way of doing this? My images are defined like so:
.. image:: image001.thumb.jpg
:alt: Some alt text here
:target: image001.jpg
So I can add an alt
attribute, but not a title. A possible alternative may be to use a target as the reference like so:
.. image:: image001.thumb.jpg
:alt: Some alt text here
:target: image1_
.. _image1: image001.jpg
In this latter case, I am not sure how to add attributes to the link defined at the bottom (if it is possible at all).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设(尝试一下!),在 lightbox 初始化后,lightbox 不再需要 title 属性。
因此,如果您想提供图像 alt 属性作为标题,那么如果您在 lightbox 初始化之后调用它,则应该这样做:
这会将 alt 属性复制到每个具有 alt 属性的图像的标题;
如果您只想修改一些图像,您可以使用以下内容来限制图像选择:
I assume (try it out!), the title attribute is no longer needed by lightbox after lightbox is initialized.
So if you'd like to provide the images alt-attributes as title, this one should do so, if you call it after lightbox-initialization:
This copies alt to title for every image that has an alt-attribute;
If you like to modify only a few images, you might restrict you images selection by using something like ...