gpt4 book ai didi

GitHub 上的 README.md 中未显示图像

转载 作者:行者123 更新时间:2023-12-02 04:21:28 33 4
gpt4 key购买 nike

我正在尝试将图像添加到 README.md 在我的存储库中使用下面的 Markdown :

![ScreenShot](https://github.com/i-saumitra/Voice-controlled-MP3-Player/blob/master/screenshot.jpg)

但是当我访问我的存储库时没有显示图像。
而是显示了图像的链接。单击链接将在新窗口中打开图像。

我也尝试过使用相对路径:
![ScreenShot](screenshot.jpg)

但这是给页面未找到错误。

中显示图像的正确 Markdown 是什么? 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)

最佳答案

更新内容

自 2013 年 1 月 30 日起,GitHub 现在支持标记文档中的相对链接。

这意味着您的代码 ![ScreenShot](screenshot.jpg)现在可以完美地工作。

正如@Brad 所指出的那样,这也可以缓解两个分支中图像不同但具有相同特征的情况。在这种情况下,从一个分支切换到另一个分支,将在渲染 View 中动态切换图像,因此不需要对自述文件内容进行任何更改。

  • Blog post announcement
  • Help article

  • GitHub 不支持相对链接时的先前答案

    您必须使用原始 url 格式。在你的情况下,这将是 https://raw.githubusercontent.com/i-saumitra/Voice-controlled-MP3-Player/master/screenshot.jpg

    这意味着正确的 Markdown 将是以下
    ![ScreenShot](https://raw.githubusercontent.com/i-saumitra/Voice-controlled-MP3-Player/master/screenshot.jpg)

    .md 中使用它github上的文件将显示以下图片;-)

    ScreenShot

    根据您的评论更新

    where is this officialy documented that we have to use raw...i couldn't find it anywhere



    此 URL 格式是 GitHub 站点的未记录功能。这意味着它可能会在以后发生变化。如果发生这种情况,为了“重新发现”新格式,请单击 原始 显示图像时的按钮。这将在浏览器中“打开”图像。复制 URL 和瞧!

    raw

    注:尽管存储库不再托管在 GitHub 上,但我更新了 url 以反射(reflect)新的 GitHub policy 关于用户内容

    关于GitHub 上的 README.md 中未显示图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11915826/

    33 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com