我在 Visual Studio Team Services 中托管的 git 存储库的根目录中有一个 README.md 文件。
当我通过项目门户导航到 Web 浏览器中的文件时,我可以看到正确呈现的 Markdown ,但图像除外。我想在 README 文件中添加一些屏幕截图,并想知道引用存储在 root of the repository/doc/images/image01.png
文件夹中的图像的正确方法
由于 README 文件也存储在存储库的根目录下,我认为它只是一个相对链接。在我的计算机 (OSX) 上使用 Visual Studio Code 时,我可以使用相对路径,并且图像可以使用图像标记正确呈现:
![Alt text](doc/images/readmeFileComparison.png?raw=true "Readme file side by side comparison")
在使用浏览器(示例 url)查看 README 文件时,图像标签是否必须不同才能让我查看图像:
有guidance from Microsoft但一定有我想念的东西。呈现 Markdown 时,我得到了一个丢失的图像标签。如果我在新选项卡中打开图像,我会收到 HTTP 500 错误和以下消息:
More information about this error
The item doc/images/pullNewChangesFromMaster.png?raw=true does not exist at the specified version, or you do not have permission to access it.
即使地址中有或缺少前导正斜杠,我也会遇到同样的错误。
![Alt text](doc/images/pullNewChangesFromMaster.png?raw=true "About to Pull down the new changes")
或
![Alt text](/doc/images/pullNewChangesFromMaster.png?raw=true "About to Pull down the new changes")
最佳答案
阅读Guidance page from Microsoft ,我没有看到任何地方提到 ?raw=true
。
所以最好不用它试试你的相对链接。
![Alt text](doc/images/pullNewChangesFromMaster.png "About to Pull down the new changes")
关于git - VSTS Markdown 文档中图像的正确地址是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42036509/