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


当前回答

有GIF文件。 推送GIF文件到你的github回购 点击该文件在github回购,以获得github地址的GIF 在你的README文件中: ! [alt文本](链接)

在下面的例子: ! [grab-landing-page] (https://github.com/winnie1312/grab/blob/master/grab-landingpage-winnie.gif)

其他回答

你可以使用![](任何图片链接)

另外,我建议使用https://stackedit.io/进行markdown格式化,这比记住所有的markdown语法要容易得多

将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">

减价备忘单:

你可以将它添加到你的repo并使用image标签引用它:

Inline-style: 
![alt text](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png "Logo Title Text 1")

Reference-style: 
![alt text][logo]

[logo]: https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png "Logo Title Text 2"

内联样式:

参考格式:


或者,您可以直接使用url:

![](http://www.reactiongifs.us/wp-content/uploads/2013/10/nuh_uh_conan_obrien.gif)

除以上所有答案外:

如果你想为你的github存储库README使用gif。md并且不想从根目录寻址它,如果你只是复制浏览器的url是不够的,例如你的浏览器url是:

https://github.com/ashkan-nasirzadeh/simpleShell/blob/master/README%20assets/shell-gif.gif

但你应该在你的github账户中打开你的GIF,右键点击它,然后点击复制图像地址或类似的东西,就像这样:

https://github.com/ashkan-nasirzadeh/simpleShell/blob/master/README%20assets/shell-gif.gif?raw=true

吉菲·戈查

在遵循上面列出的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