Tangled String Embed

Tangled's "strings" are its gist/pastebin — sh.tangled.string records living in the author's own ATProto repo. tangled-string-embed.js renders any of them inline on any page, gist-style: resolve the handle, find the PDS, fetch the record, highlight. No backend.

<script src="https://austegard.com/bsky/tangled-string-embed.js"
        data-string="at://austegard.com/sh.tangled.string/3mps32mnq6h2h"></script>

Below, the widget embeds a string containing its own source code — fetched live from this string in austegard.com's repo:

Container mode also works — one shared script tag, any number of <div data-tangled-string="handle/rkey"> elements. Same string, container-mode syntax: