If I have a .html
file in a GitHub repository, e.g. for running a a set of JavaScript tests, is there any way I can view that page directly—thus running the tests?
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?
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 & BitBucket HTML Preview allows you to render those files without cloning or downloading whole repositories. It is a client-side solution using a CORS proxy to fetch assets. If you try to open raw version of any HTML, CSS or JS file in a web browser directly from GitHub, all you will see is a source code.
You can't run codes on GitHub. The only thing that you can do is hosting a static website. Other than that, everything else is just files, you'll have to clone it in your local computer and run it.
You might want to use raw.githack.com. It supports GitHub, Bitbucket, Gitlab and GitHub gists.
https://raw.githubusercontent.com/[user]/[repository]/[branch]/[filename.ext]
In your case .html
extension
Development (throttled)
https://raw.githack.com/[user]/[repository]/[branch]/[filename.ext]
Production (CDN)
https://rawcdn.githack.com/[user]/[repository]/[branch]/[filename.ext]
In your case .html
extension
raw.githack.com also supports other services:
https://bitbucket.org/[user]/[repository]/raw/[branch]/[filename.ext]
Development (throttled)
https://bb.githack.com/[user]/[repository]/raw/[branch]/[filename.ext]
Production (CDN)
https://bbcdn.githack.com/[user]/[repository]/raw/[branch]/[filename.ext]
https://gitlab.com/[user]/[repository]/raw/[branch]/[filename.ext]
Development (throttled)
https://gl.githack.com/[user]/[repository]/raw/[branch]/[filename.ext]
Production (CDN)
https://glcdn.githack.com/[user]/[repository]/raw/[branch]/[filename.ext]
https://gist.githubusercontent.com/[user]/[gist]/raw/[revision]/[filename.ext]
Development (throttled)
https://gist.githack.com/[user]/[gist]/raw/[revision]/[filename.ext]
Production (CDN)
https://gistcdn.githack.com/[user]/[gist]/raw/[revision]/[filename.ext]
Update: rawgit was discontinued
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With