Rendering HTML from a gist or repo
Everyone hits this once. You have an HTML report in a repo — a coverage summary, a profiling output, a chart your script wrote. You push it, open the link, and GitHub shows you the source code.
That is deliberate. raw.githubusercontent.com serves everything as
text/plain with nosniff, precisely so nobody can host executable HTML on a
GitHub domain. No repo setting turns it off.
The three usual workarounds, honestly
htmlpreview.github.io
Paste your raw URL after https://htmlpreview.github.io/? and it proxies the
file with the right content type, rewriting relative references as it goes.
For a single small public file this is the fastest thing available and worth
keeping in your bookmarks.
Where it stops:
- Public only. The proxy fetches over the internet; a private repo 404s.
- Multi-file bundles are fragile. Every relative reference becomes another proxied fetch, and anything the rewriter does not recognise breaks.
- Rate limits and size. It is a free community proxy, not infrastructure you can depend on for a link you are pasting into a leadership channel.
- No access control, no comments, no versions. It is a viewer.
GitHub Pages
A real answer for a real site: build, deploy, public URL, custom domain. For a single report it is a lot of ceremony, and private Pages is a paid-plan feature with no review layer attached. Full tradeoff in GitHub Pages alternatives.
Commit a screenshot instead
The one everybody actually does. It works, and it destroys every number in the report — nothing is checkable, nothing is searchable, and the interactive chart becomes a picture of a chart. See stop screenshotting reports.