我想把这个gif添加到一个GitHub风味markdown文件。如果不能在GitHub中完成,是否有可能在另一个版本的markdown中完成?


当前回答

使用HTML的img标签,然后给出源url。

<img src="https://...thumbs-up.gif">

其他回答

只需将gif文件上传到GitHub的基本文件夹中,并编辑README即可。我们就用这个代码

! [] (name-of-giphy.gif)

吉菲·戈查

在遵循上面列出的2个要求之后(必须以.gif结尾,并使用图像语法),如果你在使用来自giphy的gif时遇到问题:

请确保您有正确的giphy url!你不能只是在这个文件的末尾加上。gif就能让它工作。

如果你只是从浏览器复制url,你会得到类似这样的东西:

https://giphy.com/gifs/gol-automaton-game-of-life-QfsvYoBSSpfbtFJIVo

你需要点击“复制链接”,然后专门抓取“GIF链接”。注意正确的指向media.giphy.com而不是仅仅指向giphy.com:

https://media.giphy.com/media/QfsvYoBSSpfbtFJIVo/giphy.gif

使用HTML的img标签,然后给出源url。

<img src="https://...thumbs-up.gif">

将url从

https://github.com/nikhith265/submit_button_group/blob/master/attachments/gif/sample_gif.gif

to

https://raw.githubusercontent.com/nikhith265/submit_button_group/298c26b5a3fcfe936f16deef0e8712c2fdc1b635/attachments/gif/sample_gif.gif

注意:确保从url中删除/blob

然后使用img标签,如下所示将gif添加到。md

<img src="https://raw.githubusercontent.com/nikhith265/submit_button_group/298c26b5a3fcfe936f16deef0e8712c2fdc1b635/attachments/gif/sample_gif.gif" alt="gif" width="300" height="540">

从本地上传:

将您的.gif文件添加到Github存储库的根目录并推送更改。 访问README.md [Alt text](name-of-gif-file.gif) / ![](name-of-gif-file.gif) 应该会看到Commit和gif。

使用url显示gif:

访问README.md [Alt text](https://sample/url/name-of-gif-file.gif) 应该会看到Commit和gif。

希望这能有所帮助。