本站消息

站长简介/公众号

  出租广告位,需要合作请联系站长


+关注
已关注

分类  

暂无分类

标签  

暂无标签

日期归档  

暂无数据

在 GitHub README.rst 中嵌入 Shields IO Badge HTML

发布于2021-10-11 23:36     阅读(150)     评论(0)     点赞(27)     收藏(4)


我正在尝试将 Shield IO Badges 包含在我正在处理的 GitHub 项目的 README.rst 文件中。Shield IO 徽章具有对两个链接进行编码的功能(一个在徽章的左侧,一个在徽章的右侧),我想将其包含在项目自述文件中。https://shields.io/,为了使用双链接功能,徽章必须以 HTML 编码<object>标签。reStructuredText 具有原始功能,可以在解析并包含在自述文件中的文件中包含 HTML 代码片段。PyCharm 解释器可以正确解析 HTML,并且存在双链接功能。但是,当我将文件推送到 GitHub 时,根本没有解析 HTML。很好奇是否有解决方法可以在 GitHub README 文件中获取此功能(不一定必须是 reStructuredText)。

例子:

.. raw:: html

       <object data="https://img.shields.io/static/v1?label=Question&message=Unanswered&color=lightgrey&link=https://stackoverflow.com/&link=https://stackoverflow.com/questions/66716288/embedding-shields-io-badge-html-in-github-readme-rst"></object>

示例徽章图像:

示例 Shield IO 徽章图像

Link to Shield IO Static Badge with Dual Link 功能:

https://img.shields.io/static/v1?label=Question&message=Unanswered&color=lightgrey&link=https://stackoverflow.com/&link=https://stackoverflow.com/questions/66716288/embedding-shields-io-徽章-html-in-github-readme-rst


解决方案


这是不可能的。Github 从 Markdown 和 reStrcturedText 中的 SVG 中删除链接。在 Github 上查看此问题。

如何在 GitHub 上指定左右链接 #5593




所属网站分类: 技术文章 > 问答

作者:黑洞官方问答小能手

链接:http://www.qianduanheidong.com/blog/article/202002/833375bd2e9d6cc2cb39/

来源:前端黑洞网

任何形式的转载都请注明出处,如有侵权 一经发现 必将追究其法律责任

27 0
收藏该文
已收藏

评论内容:(最多支持255个字符)