【问题标题】:Adding images to Readme of plugin in pub.dev将图像添加到 pub.dev 中的插件自述文件
【发布时间】:2020-09-12 23:07:16
【问题描述】:

我在 pub.dev 中有一个名为 UPI India 的插件,其自述文件包含两个图像。这两个图像在 Github 的自述文件中可见,但在 pub.dev 的自述文件中不可见

Pub 中的图片

Github 中的图片

我在自述文件中使用绝对路径。

<table>
  <tr>
    <td><img src="https://github.com/mdazharuddin1011999/UPI-Plugin-Flutter/blob/master/images/success.jpg" alt="Success Status" width="200"></td>
    <td><img src="https://github.com/mdazharuddin1011999/UPI-Plugin-Flutter/blob/master/images/show.gif" alt="How example looks" width="200"></td>
  </tr>
</table>

有人知道为什么会这样吗?

【问题讨论】:

  • 它们看起来对我来说是可见的
  • 我实际上解决了这个问题。而不是使用存储在存储库本身中的文件。我将文件上传到 github cdn 服务器并使用了该链接。抱歉我忘记更新了。

标签: flutter-plugin readme


【解决方案1】:

问题解决了!
我使用了 cdn 链接而不是存储库链接。

<img src="https://user-images.githubusercontent.com/42082172/82893565-d3643480-9f6e-11ea-96a7-493181df6214.gif" alt="How example looks" width="300" height="540">

<img src="https://user-images.githubusercontent.com/42082172/82893023-1245ba80-9f6e-11ea-868d-a55062d34086.jpg" alt="Success Status" width="300" height="540">

希望它对将来的人有所帮助。

【讨论】:

    【解决方案2】:

    有一种更简单的方法,您可以尝试这样的事情:

    <table>
      <tr>
        <td><img src="https://github.com/mdazharuddin1011999/UPI-Plugin-Flutter/raw/master/images/success.jpg" alt="Success Status" width="200"></td>
        <td><img src="https://github.com/mdazharuddin1011999/UPI-Plugin-Flutter/raw/master/images/show.gif" alt="How example looks" width="200"></td>
      </tr>
    </table>
    

    只需将您的 Github 网址中的 /blob/ 更改为 /raw/

    【讨论】:

      猜你喜欢
      • 2020-12-04
      • 1970-01-01
      • 2021-09-02
      • 2017-06-18
      • 2020-05-18
      • 2014-05-19
      • 1970-01-01
      • 1970-01-01
      • 2021-07-12
      相关资源
      最近更新 更多