我可以直接从 GitHub 运行 HTML 文件,而不仅仅是查看它们的源代码吗?
如果我在GitHub存储库中有一个文件,例如用于运行一组JavaScript测试,那么有没有办法直接查看该页面 - 从而运行测试?.html
例如,我是否可以以某种方式实际看到jQuery测试套件将生成的测试结果,而无需将存储库下载或克隆到我的本地驱动器并在那里运行它们?
我知道这基本上会把GitHub放在静态内容托管业务中,但话说回来,他们只需要将他们的哑剧类型从文本/纯文本更改为.text/html
如果我在GitHub存储库中有一个文件,例如用于运行一组JavaScript测试,那么有没有办法直接查看该页面 - 从而运行测试?.html
例如,我是否可以以某种方式实际看到jQuery测试套件将生成的测试结果,而无需将存储库下载或克隆到我的本地驱动器并在那里运行它们?
我知道这基本上会把GitHub放在静态内容托管业务中,但话说回来,他们只需要将他们的哑剧类型从文本/纯文本更改为.text/html
您可能希望使用 raw.githack.com。它支持GitHub,Bitbucket,Gitlab和GitHub gists。
https://raw.githubusercontent.com/[user]/[repository]/[branch]/[filename.ext]
在您的情况下扩展.html
开发(节流)
https://raw.githack.com/[user]/[repository]/[branch]/[filename.ext]
生产
https://rawcdn.githack.com/[user]/[repository]/[branch]/[filename.ext]
在您的情况下扩展.html
raw.githack.com 还支持其他服务:
https://bitbucket.org/[user]/[repository]/raw/[branch]/[filename.ext]
开发(节流)
https://bb.githack.com/[user]/[repository]/raw/[branch]/[filename.ext]
生产
https://bbcdn.githack.com/[user]/[repository]/raw/[branch]/[filename.ext]
https://gitlab.com/[user]/[repository]/raw/[branch]/[filename.ext]
开发(节流)
https://gl.githack.com/[user]/[repository]/raw/[branch]/[filename.ext]
生产
https://glcdn.githack.com/[user]/[repository]/raw/[branch]/[filename.ext]
https://gist.githubusercontent.com/[user]/[gist]/raw/[revision]/[filename.ext]
开发(节流)
https://gist.githack.com/[user]/[gist]/raw/[revision]/[filename.ext]
生产
https://gistcdn.githack.com/[user]/[gist]/raw/[revision]/[filename.ext]
更新:rawgit 已停产
有一个名为GitHub HTML Preview的新工具,它可以完全按照您的要求进行操作。只需在任何HTML文件的URL前面,例如 http://htmlpreview.github.io/?https://github.com/twbs/bootstrap/blob/gh-pages/2.3.2/index.htmlhttp://htmlpreview.github.io/?
注意:此工具实际上是一个 github.io 页面,并且不隶属于github作为一家公司。