Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
472 views
in Technique[技术] by (71.8m points)

javascript - 我可以直接从GitHub运行HTML文件,而不仅仅是查看它们的来源吗?(Can I run HTML files directly from GitHub, instead of just viewing their source?)

If I have a .html file in a GitHub repository, eg for running aa set of JavaScript tests, is there any way I can view that page directly—thus running the tests?(如果我在GitHub存储库中有一个.html文件,例如用于运行一组JavaScript测试,我有什么方法可以直接查看该页面 - 从而运行测试?)

For example, could I somehow actually see the test results that would be produced by the jQuery test suite , without downloading or cloning the repo to my local drive and running them there?(例如,我可以以某种方式实际看到由jQuery测试套件生成的测试结果,而无需将repo下载或克隆到我的本地驱动器并在那里运行它们吗?) I know this would basically put GitHub in the static content hosting business, but then again, they just have to change their mime-type from text/plain to text/html .(我知道这基本上会把GitHub放在静态内容托管业务中,但是再一次,他们只需要将他们的mime-type从text/plain更改为text/html 。)   ask by Domenic translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You might want to use raw.githack.com .(您可能想使用raw.githack.com 。)

It supports GitHub, Bitbucket, Gitlab and GitHub gists.(它支持GitHub,Bitbucket,Gitlab和GitHub。) GitHub(GitHub上) Before:(之前:) https://raw.githubusercontent.com/[user]/[repository]/[branch]/[filename.ext] In your case .html extension(在您的情况下.html扩展名) After:(后:) Development (throttled)(发展(受限制)) https://raw.githack.com/[user]/[repository]/[branch]/[filename.ext] Production (CDN)(生产(CDN)) https://rawcdn.githack.com/[user]/[repository]/[branch]/[filename.ext] In your case .html extension(在您的情况下.html扩展名) raw.githack.com also supports other services:(raw.githack.com还支持其他服务:) Bitbucket(到位桶) Before:(之前:) https://bitbucket.org/[user]/[repository]/raw/[branch]/[filename.ext] After:(后:) Development (throttled)(发展(受限制)) https://bb.githack.com/[user]/[repository]/raw/[branch]/[filename.ext] Production (CDN)(生产(CDN)) https://bbcdn.githack.com/[user]/[repository]/raw/[branch]/[filename.ext] GitLab(GitLab) Before:(之前:) https://gitlab.com/[user]/[repository]/raw/[branch]/[filename.ext] After:(后:) Development (throttled)(发展(受限制)) https://gl.githack.com/[user]/[repository]/raw/[branch]/[filename.ext] Production (CDN)(生产(CDN)) https://glcdn.githack.com/[user]/[repository]/raw/[branch]/[filename.ext] GitHub gists(GitHub要点) Before:(之前:) https://gist.githubusercontent.com/[user]/[gist]/raw/[revision]/[filename.ext] After:(后:) Development (throttled)(发展(受限制)) https://gist.githack.com/[user]/[gist]/raw/[revision]/[filename.ext] Production (CDN)(生产(CDN)) https://gistcdn.githack.com/[user]/[gist]/raw/[revision]/[filename.ext] Update: rawgit was discontinued(更新:rawgit已停产)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...