如何在MarkDown中创建指向GitHub原始文件的相对链接?

5
GitHub MD支持相对链接,例如从我的README.md文件中,我可以链接到Code目录中的代码:
To download these scripts, [click here](Code/myscript.sh), then right-click the **Raw** button and download it

如何使用相对链接直接链接到原始内容,例如Code/myscript.sh而不是绝对链接,如https://raw.githubusercontent.com/myrepo/toplevel/subdir/subsubdir/myscript.sh)?

1
这个重要的问题/答案的浏览量如此之少,令人惊讶。 - WestCoastProjects
1个回答

10
raw=1添加到您的URL中。
To download these scripts, [click here](Code/myscript.sh?raw=1).

我在文档中没有找到这方面的说明,是通过试验发现的,所以在这里分享一下。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接