如何在 github 的降价文档中显示图标 'mdi'

How to display icons 'mdi' in a markdown document for github

我正在编写一些文档,我需要在降价文件的 table 中显示一些图标。

为了提高可维护性,我使用了 html 数组结构。

而我使用的图标来自这个library

我的代码示例:

<table>
  <thead>
    <tr>
      <th>icon</th>
      <th>Button name or features</th>
      <th>Name of the icon</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>
        <svg style="width:24px;height:24px" viewBox="0 0 24 24">
          <path fill="#000000"
            d="M6,17C6,15 10,13.9 12,13.9C14,13.9 18,15 18,17V18H6M15,9A3,3 0 0,1 12,12A3,3 0 0,1 
            9,9A3,3 0 0,1 12,6A3,3 0 0,1 15,9M3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 
            19,3H5C3.89,3 3,3.9 3,5Z" />
        </svg>
      </td>
      <td>User information</td>
      <td>account-box</td>
    </tr>
  </tbody>
<table>

提前致谢!

我刚刚回答了我的问题,我找到了解决方法。最初,我想使用标签在 README.md 文件中显示图标:

<svg style="width:24px;height:24px" ...>
    <path ... />
</svg>

但我不知道该怎么做。

所以我使用另一种方法:

html中的例子:<img src="icons/png/github-circle.png">

降价示例: ![image](icons/png/github-circle.png)

您只需要使用一个允许下载以下格式图标的库: .png.jpg.gif.svg。 这里是 a documentation,其中快速解释了图像的主题。

my example on github 我有这样一个文件夹:

  • icons
    • svg
      • icon1
      • icon2
      • icon3 ...
    • png
      • icon1
      • icon2
      • icon3 ...

我在这里用经典的方式来寻找元素的路径。 如果有人有更好的主意,请毫不犹豫地分享。 祝你有美好的一天 !