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).
More from coding & agent
- Coding agents are heading toward an AI-writes, AI-reviews, human-approves workflow — aftahi_ai · 2026-07-22
- oMLX 0.5.2 adds Mac menu-bar stats, low-bit decode kernels, and faster downloads — awnihannun · 2026-07-22
- GitHub review bot hits its PR limit and forces a 39-minute cooldown — DanielLockyer · 2026-07-22
- Max reasoning effort appears to be mobile-only in Codex Remote, not desktop — GabGarrett · 2026-07-22
- A Reddit demo argues online stores should expose carts and pricing through MCP — gelembjuk · 2026-07-22
- Open-source AI SDK provider routes Vercel apps through a local Codex subscription — lgrammel · 2026-07-22