我想把这个gif添加到一个GitHub风味markdown文件。如果不能在GitHub中完成,是否有可能在另一个版本的markdown中完成?
当前回答
另一种更简单的方法是在浏览器(chrome)中打开你的git存储库,点击编辑README.md
然后只需拖拽您的gif/png/jpeg文件从您的本地机器磁盘和自动文件将上传和链接将放置在README。Md文件,如下所示

想要添加的文件

其他回答
减价备忘单:
你可以将它添加到你的repo并使用image标签引用它:
Inline-style:

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:

只需将gif文件上传到GitHub的基本文件夹中,并编辑README即可。我们就用这个代码
! [] (name-of-giphy.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">
除以上所有答案外:
如果你想为你的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
你可以使用
另外,我建议使用https://stackedit.io/进行markdown格式化,这比记住所有的markdown语法要容易得多
推荐文章
- 在Markdown Jekyll中使用图像说明
- Slack Markdown链接没有解决
- 差异语法突出显示在Github Markdown
- 我如何创建一个文本框的笔记在markdown?
- 在Markdown中创建一个没有标题的表
- R -降价避免包装加载消息
- 在MarkDown中包含SVG(托管在GitHub上)
- 自动TOC在github风味markdown
- 使用pandoc从Markdown转换为PDF时设置空白大小
- 如何显示数学方程在一般github的markdown(不是github的博客)
- 使用Markdown的Sphinx而不是reST
- 降价和图像对齐
- 如何样式一个JSON块在Github维基?
- 标记“本机”文本对齐方式
- Markdown和包括多个文件