Many GitHub repositories don't use GitHub Pages to host their HTML files. GitHub & BitBucket HTML & Markdown 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. GitHub forces them to use the "text/plain" content-type, so they cannot be interpreted. This script overrides it by using a CORS proxy.
- HTML preview — renders
.htmlfiles with their referenced CSS, JS, frames and images proxied through CORS. - Markdown rendering —
.mdfiles are rendered with marked and styled with github-markdown-css to look like GitHub, with automatic light/dark mode. - Collapsible table of contents — when a Markdown file has 3+ headings, a sticky sidebar outline is generated with tocbot, with smooth scrolling and active-section highlighting. Toggle it from the ☰ button.
- Cross-file navigation — links between hosted HTML/Markdown files are rewritten to load through the preview, and same-file anchors keep working.
In order to use it, just prepend this fragment to the URL of any HTML or Markdown file: https://mdrenderer.github.io/? e.g.:
- https://mdrenderer.github.io/?https://github.com/twbs/bootstrap/gh-pages/2.3.2/index.html
- https://mdrenderer.github.io/?https://github.com/documentcloud/backbone/blob/master/examples/todos/index.html
- https://mdrenderer.github.io/?https://github.com/mdrenderer/mdrenderer.github.com/blob/master/readme.md
What it does is: load the file using a CORS proxy, then either process all links, frames, scripts and styles for HTML, or parse Markdown to HTML and inject the GitHub stylesheet and outline sidebar.
GitHub & BitBucket HTML & Markdown Preview was tested under the latest Google Chrome and Mozilla Firefox.
© 2019 Jerzy Głowacki, © 2026 Andreas Kirsch / Claude Code, under Apache License 2.0.