GitHub Enterprise中的降价文件中的图像 [英] Images in markdown files in GitHub Enterprise

查看:107
本文介绍了GitHub Enterprise中的降价文件中的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



有趣的是,我使用的是与我在公共场合使用的代码片段相同的代码片段存储库,即

 ![alt text](https://raw.github.com/repository/project/master/filename png)

不幸的是,这种命令不适用于企业项目。



我看到图片的原始版本有一个很大的区别。具体来说,在企业存储库中,我有一个查询参数的原始图片文件的URL,例如

 ?token = AAABGqiVI6Qk6Mi4ZM0ZBeHrXexkUBmNks5W_AyCwA %3D%3D 

有人知道如何在GutHub企业中的Markdown中嵌入图片吗?

解决方案

您是否尝试过使用相对链接指向图片?所以试图做一些像![](img / image_name.png)?我之所以推荐这样做,是因为如果他们正在使用您的回购,他们应该拥有这些图片,无论他们是否在线访问,GitHub都会正确处理渲染。这是假设你想让这些信息面向其他人看到它。



它实际上是由GitHub建议不是使用绝对链接,如 [绝对自述文件链接](https://github.com/username/repo/blob/branch/docs/more_words.md) 来源



编辑:我也发现这个问题/在SO上回答可能有助于提及如何解决这个问题。它还提到了相关链接:


GitHub建议您使用相对链接与?raw = true 参数,以确保分叉的回购点正确。


它还谈论如何有一个单独的分支,可以包含所有的截图,你可以参考它们:
![Alt text](/../& <分支名称> /path/to/image.png?raw = true可选标题)



希望这有助于您!


I'm working on a README.md file in a GitHub Enterprise repository.

It's funny, I'm using the same code snippet I use in my public repositories, i.e.

![alt text](https://raw.github.com/repository/project/master/filename.png)

Unfortunately, this kind of command doesn't work on the enterprise project.

I see one big difference in the raw version of a picture. Specifically, in the enterprise repository I have a the URL of the raw picture file with a query parameter, e.g.

?token=AAABGqiVI6Qk6Mi4ZM0ZBeHrXexkUBmNks5W_AyCwA%3D%3D

Does someone know how to embed a picture in a markdown in GutHub enterprise?

解决方案

Have you tried working with using relative links to your images? So trying to do something like ![](img/image_name.png)? The reason why I recommend this is because if they are working with your repo, they should have these images regardless and if they are accessing this online, GitHub will handle the rendering properly. This is assuming that you want this information to be facing towards others to be able to see it.

It is actually recommended by GitHub to not use absolute links such as [Absolute README link](https://github.com/username/repo/blob/branch/docs/more_words.md) Source

Edit: I also found this question/answer on SO that might be useful to refer to about how to solve it. It also mentions with the relative linking:

GitHub recommend that you use relative links with the ?raw=true parameter to ensure forked repos point correctly.

It also talks about how you can have a separate branch that can contain all of your screenshots and you can reference them as: ![Alt text](/../<branch name>/path/to/image.png?raw=true "Optional Title")

Hope this helps!

这篇关于GitHub Enterprise中的降价文件中的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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