我阅读了一篇博客文章,介绍了如何访问GitHub中的原始内容:
我有一个仓库mbigras/hello-world,其中包含一个维基页面mbigras/hello-world/wiki/foobar。因此,根据上述模式,以下内容应该有效:This is not entirely obvious (at least it wasn’t for me), but since Github wikis are actually backed by a proper Git repo, I figured it should be possible to access the raw markdown for a page by using Github’s https://raw.github.com/ style URLs.
After some minor trial/error, it turns out to be very predictable (as many things in github):
https://raw.github.com/wiki/[user]/[project]/[page].md
https://raw.github.com/wiki/mbigras/hello-world/foobar.md
似乎GitHub已更改其路由如下所示:
$ curl https://raw.github.com/wiki/mbigras/hello-world/foobar.md
$ curl -Is https://raw.github.com/wiki/mbigras/hello-world/foobar.md 2>&1 | head -n 2
HTTP/1.1 301 Moved Permanently
Location: https://raw.githubusercontent.com/wiki/mbigras/hello-world/foobar.md
$ curl -L https://raw.github.com/wiki/mbigras/hello-world/foobar.md
{
"foo": "bar",
"cat": "dog",
"red": "hat"
}
因此,新的模式似乎是:
https://raw.githubusercontent.com/wiki/[user]/[project]/[page].md
GitHub是否发布有关如何访问wiki页面的原始markdown源代码的文档?