VSTS降价文档中图像的正确地址是什么? [英] What is the correct address for an image in a markdown document in VSTS?

查看:79
本文介绍了VSTS降价文档中图像的正确地址是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Visual Studio Team Services中托管的git存储库的根目录中有一个README.md文件.

I have a README.md file in the root of my git repository hosted in Visual Studio Team Services.

当我通过项目门户导航到Web浏览器中的文件时,除了图像之外,我可以看到正确渲染的减价.我想将一些屏幕截图添加到README文件中,并想知道引用存储在root of the repository/doc/images/image01.png

When I navigate to the file in the web browser through the project portal I can see the correctly rendered markdown except for the images. I would like to add some screenshots to the README file and would like to know the correct way to reference an image stored stored in a folder at the root of the repository/doc/images/image01.png

由于README文件也存储在存储库的根目录中,因此我认为这只是一个相对链接.在计算机(OSX)上使用Visual Studio Code时,我可以使用相对路径,并且可以使用image标记正确地渲染图像,如下所示:

As the README file is also stored at the root of the repository I thought it would just be a relative link. When using Visual Studio Code on my computer (OSX) I can use relative paths and the images render correctly using the image tag as so:

![Alt text](doc/images/readmeFileComparison.png?raw=true "Readme file side by side comparison")

在使用浏览器(例如url)查看README文件时,图像标记是否必须不同才能使我查看图像?

Does the image tag have to be different in order for me to view images when viewing the README file with the browser at (example url):

https://myaccount .visualstudio.com/ProjectName/_git/repositoryName?path =%2FREADME.md& version = GBmaster& _a = contents

Microsoft提供了指南,但是一定有我想念的东西.降价时,我得到了一个丢失的图像标签.如果在新标签页中打开图像,则会收到HTTP 500错误和以下消息:

There is guidance from Microsoft but there must be something I am missing. When the markdown is rendered I get a missing image tag. If I open the image in a new tab I get a HTTP 500 Error and the following message:

有关此错误的更多信息

More information about this error

项目doc/images/pullNewChangesFromMaster.png?raw = true不 存在于指定的版本,或者您没有权限 访问它.

The item doc/images/pullNewChangesFromMaster.png?raw=true does not exist at the specified version, or you do not have permission to access it.

即使地址中有或缺少地址中的正斜杠,我也会遇到相同的错误.

I get the same error even if the addresses have or are missing a leading forward slash from the address.

 ![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")

推荐答案

阅读来自Microsoft的指导页面,我在任何地方都看不到?raw=true.

Reading the Guidance page from Microsoft, I do not see ?raw=true mentioned anywhere.

因此,最好在没有链接的情况下尝试使用它.

So it is best to try your relative link without it.

![Alt text](doc/images/pullNewChangesFromMaster.png "About to Pull down the new changes")

这篇关于VSTS降价文档中图像的正确地址是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆