我想在图像中使用下面降价我的库添加到README.md:
![ScreenShot](https://github.com/i-saumitra/Voice-controlled-MP3-Player/blob/master/screenshot.jpg)
但是,当我访问我的库中的图像不显示。 相反,链接到的图像显示出来。 点击该链接就会打开新的窗口形象。
我曾尝试使用相对路径也尝试:
![ScreenShot](screenshot.jpg)
但是,这是给找不到网页的错误。
什么是正确的降价在README.md显示图像
无论README.md和图像文件都在相同的路径/目录。
什么是显示github上README.md图像的正确方法是什么?
README.md文件的完整内容如下:
Voice-controlled-MP3-Player
===========================
A MP3 player which accept voice command like PLAY, PAUSE, FORWARD, etc. Using C# and Microsoft Speech API.
![ScreenShot](https://github.com/i-saumitra/Voice-controlled-MP3-Player/blob/master/screenshot.jpg)
Updated content
Since January, 30th 2013, GitHub now supports relative links in markup documents.
This means that your code ![ScreenShot](screenshot.jpg)
would now work flawlessly.
As pointed by @Brad, this may also ease a scenario where the images are different in two branches, but bear the same. In that case, switching from one branch to another, would dynamically switch the image in the rendered view, thus without requiring any change to the Readme content.
- Blog post announcement
- Help article
Previous answer when GitHub wasn't supporting relative links
You have to use the raw url format. In your case that would be https://raw.githubusercontent.com/i-saumitra/Voice-controlled-MP3-Player/master/screenshot.jpg
This means that the correct markdown would be the following
![ScreenShot](https://raw.githubusercontent.com/i-saumitra/Voice-controlled-MP3-Player/master/screenshot.jpg)
Using this in a .md
file on github will display the following picture ;-)
Update following your comment
where is this officialy documented that we have to use raw...i couldn't find it anywhere
This URL format is an undocumented feature of the GitHub site. This means that it could change later. If that ever happens, in order to "rediscover" the new format, click the Raw button when displaying a image. This will "open" the image in your browser. Copy the URL and Voilà!
Note: Although the repository is no longer on hosted on GitHub, I've updated the urls to reflect the new GitHub policy regarding user content
你真的应该使用相对URL。 这样,他们会工作的私人回购更好。
![ScreenShot](/screenshots/latest.png)
假设你已经回购了latest.png截图文件夹内。
一B
对于相对URL的与图像工作,把它包装的段落标记内。
与单个图像的工作,当我面临的问题,尤其是。
例:
<p>
<img src="relativePath/file.png" width="220" height="240" />
</p>
这可能不是有关以前的答案。 我作为OP同样的问题 - 我在这里指导和它没有帮助我。 我希望我能帮助补充光线但是这个问题-因为它占地为什么图像不渲染可能性README.md
文件。
该issue
我遇到的是,文件名README.md
文件写成readME
它不仅缺少.md
它也有不同的写法。
显然,我们不应该重命名README.md
文件。 它必须是该文件的原始名称,以使你想github上上载的图片或GIF README.md
页。 希望这可以帮助别人,在罕见的情况下,就像我一样。
侧面说明,使用新结构化使用的时候:
.. image:: /screenshots/latest.png?raw=true