【问题标题】:How to display icons 'mdi' in a markdown document for github如何在 github 的降价文档中显示图标“mdi”
【发布时间】:2020-01-08 21:47:57
【问题描述】:

我正在编写一些文档,我需要在 markdown 文件的表格中显示一些图标。

为了提高可维护性,我使用了 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>

提前致谢!

【问题讨论】:

    标签: html github icons markdown


    【解决方案1】:

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

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

    但我不知道如何做到这一点。

    所以我使用了另一种方法:

    html 中的示例: &lt;img src="icons/png/github-circle.png"&gt;

    ma​​rkdown 中的示例: ![image](icons/png/github-circle.png)

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

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

    • 图标
      • svg
        • 图标1
        • 图标2
        • icon3 ...
      • png
        • 图标1
        • 图标2
        • icon3 ...

    我来这里以经典的方式寻找元素的路径。 如果有人有更好的想法,请不要犹豫分享。 祝你有美好的一天 !

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-04-21
      • 2013-02-15
      • 2022-06-21
      • 1970-01-01
      • 1970-01-01
      • 2014-09-26
      • 2023-03-20
      • 2020-08-16
      相关资源
      最近更新 更多