Building a GitHub Code Embed Web Component with GPT

Simon Willison · rss · 2026-07-08

The author shares an experimental Web Component, <github-code>, built using GPT. The component is designed to easily embed and display GitHub code snippets on web pages.

How it works: Users simply provide the URL of a GitHub file (with the ability to specify line ranges). The component automatically converts this into a raw.githubusercontent.com link, fetches the code content via fetch(), and ultimately displays the specified code block with line numbers on the page (syntax highlighting is not currently supported).

Original post →

More from coding & agent

coding & agent channel →