我读a blog post描述如何访问GitHub的内部原始内容:如何访问GitHub wiki页面的原始降价文档在哪里?
这并不完全是显而易见的(至少这不是对我来说),但维基因为 Github上通过适当的Git支持实际回报,我想它 应该可以通过使用 Github的https://raw.github.com/样式URL访问页面的原始降价。
一些小的试验/错误后,它原来是很容易预测(如在 GitHub的很多东西):
https://raw.github.com/wiki/[user]/[project]/[page].md
我有一个回购mbigras/hello-world与mbigras/hello-world/wiki/foobar维基页面。因此,根据按照上述模式应该工作:
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页面的原始降价源的文档吗?
这似乎并不工作了 - 2018年2月 – Federico