2015-12-17 233 views
58

我想将此gif添加到GitHub风格的降价文件中。如果它不能在GitHub中完成,是否可以在另一个版本的Markdown中完成?有没有办法添加一个GIF到Markdown文件?

+0

可能重复[如何添加屏幕截图到README文件在github存储库?](http://stackoverflow.com/questions/10189356/how-to-add-screenshot-to-readmes-in-github-repository)或[添加图像到github上的README.md](http://stackoverflow.com/questions/14494747/add-images-to-readme-md-on-github?rq=1) –

回答

89

显示GIF格式需要两样东西

1-使用此语法在these examples

![Alt Text](https://media.giphy.com/media/vFKqnCdLPNOKc/giphy.gif)

产量:

Alt Text

2-图像URL必须以GIF

3-结束为后人:如果上面曾经.gif文件链接变坏,你将看不到图像,而是看到了ALT-文字和网址,就像这样:

Alt Text

4-调整大小的GIF您可以在这个Github tutorial link

<img src="https://media.giphy.com/media/vFKqnCdLPNOKc/giphy.gif" width="40" height="40" /> 

产量使用这个语法:

+32

upvoted因为该gif有趣 – user1754322

+6

downvoted,因为gif令人沮丧 –

+1

@NikKov真实!这是一个技术问题。 –

86

Markdown Cheatsheet

你可以把它添加到您的回购协议,并与图像标记引用它:

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" 

内嵌式: alt text

参考风格: alt text


或者您可以使用the url directly

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

你,我喜欢你! – GabrielOshiro

+0

@erip如何使用Giphy的GIF? – AbhimanyuAryan

+1

@AhimanyuAryan你可以通过右键单击并获取地址来找到这些gif的地址。例如:https://media.giphy.com/media/MoYC1N4nv7Fcs/giphy.gif – erip

0

Giphy疑难杂症

后按照上面列出的2项要求(必须.gif结束,并使用图像语法),如果您有来自giphy GIF格式的麻烦:

确保您有正确的giphy网址!

如果你只是从浏览器中复制网址,你会得到这样的:

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

你不能只是增加.gif这一个的末端,它的工作。

你需要,而不是点击“复制链接”,然后抢“GIF链接”明确:

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

注意正确的点media.giphy.com而不是仅仅giphy.com

相关问题