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.

The alternative: publish the file, keep the access rules

If what you want is this HTML, at a URL, for these people, the repo was never the right container. Publishing takes one motion:

  • Drag the file — or the whole folder, or a zip — into the app, or POST it from a script or an agent over MCP.
  • Pick visibility: private, team, email-domain-gated, named reviewers, or public. Identity, not a shared password.
  • Get anchored comment threads on the rendered page, and a revision each time you republish to the same id — so the link in your README never goes stale and never changes.

Scripts run, sandboxed (allow-scripts, no allow-same-origin), which is the same reason GitHub refuses to render your file — except the sandbox is the product's job rather than your repo's problem.

At a glance

Option Private files Multi-file bundles Comments / versions Setup
Comma Yes, identity-based Yes, rewritten Yes / yes Drag or one POST
htmlpreview No Fragile No Paste a URL
GitHub Pages Paid plans Yes No Branch + deploy
raw.githubusercontent Token-gated N/A No Renders as text

Checked August 2026. Verify current plans before committing.

How to choose

  • Quick look at a public single-file demo? htmlpreview, every time.
  • A site with routes? GitHub Pages, Netlify, or Cloudflare Pages.
  • A report — private, versioned, and something people should respond to? Publish it: share an HTML report.