【问题标题】:I want to create an image in reStructuredText, which will have an alternative (<alt>) in html and still work in pdf我想在 reStructuredText 中创建一个图像,它将在 html 中有一个替代 (<alt>) 并且仍然可以在 pdf 中工作
【发布时间】:2021-12-29 20:17:19
【问题描述】:

所以我正在编写 reStructuredText,它同时创建一个 HTML 页面和一个 PDF。我想在 HTML 中为图像添加替代文本,但是当我在代码中添加它时,图像在 PDF 中不起作用!

我的代码没有替代文本(在这两种情况下都有效):

.. image:: https://********.jpg

我的代码在 PDF 中不起作用:

|alternative en plusieurs mots|

.. |alternative en plusieurs mots| image:: https://*********.jpg

【问题讨论】:

    标签: restructuredtext


    【解决方案1】:

    从 docutils image directive 的文档中,以下内容应该有效:

    .. image:: https://********.jpg
        :alt: alternative en plusieurs mots
    

    【讨论】:

    • 谢谢!它工作得很好我觉得很愚蠢啊哈哈
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-02-18
    • 1970-01-01
    • 1970-01-01
    • 2014-04-20
    • 2012-11-12
    • 2022-01-24
    • 2019-07-21
    相关资源
    最近更新 更多