gpt4 book ai didi

http - 有关如何访问 GitHub wiki 页面的原始 Markdown 的文档在哪里?

转载 作者:可可西里 更新时间:2023-11-01 16:09:13 26 4
gpt4 key购买 nike

我读了a blog post描述如何访问 GitHub 中的原始内容:

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

我有一个仓库 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 页面的原始 markdown 源的文档?

最佳答案

GitHub 是否发布有关如何访问 wiki 页面的原始 markdown 源的文档?

是的,GitHub 在 blog 中记录了如何导出 wiki , 2010 年 Wiki 发布时。

Each wiki is a Git repository, so you're able to push and pull them like anything else. Each wiki respects the same permissions as the source repository. Just add ".wiki" to any repository name in the URL, and you're ready to go.

在你的mbigras/hello-world情况下,命令将是:

git clone https://github.com/mbigras/hello-world.wiki.git

关于http - 有关如何访问 GitHub wiki 页面的原始 Markdown 的文档在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43212618/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com