A Chrome extension to render HTML/JavaScript/CSS from ChatGPT into iframes.
Status: experimental.
See also: This is now live on the Chrome Web Store.
The extension adds a "render" button to any HTML or PlantUML code blocks in a ChatGPT conversation.
Clicking the button renders the HTML in an iframe, and allows selecting other code blocks (JavaScript, CSS) from the conversation for inclusion, mixing and matching sources.
rendergpt.*.zip
file, and extract it.chrome://extensions
.ChatGPT does pretty well with structured output. I've had success getting it to build diagrams with PlantUML syntax, draw SVGs of varying complexity, and of course compose HTML, CSS, and JavaScript.
Writing some interactive JavaScript:
Generating a PlantUML diagram from source code:
First, build the extension in development mode with the dev Babashka task:
$ bb dev
Or equivalently, via npm, npx shadow-cljs watch :app
.
Second, load the public/ directory as an unpacked extension in Chrome/Brave.
Finally, start a ChatGPT conversation. The "render" button only appears for code blocks tagged "html" for now.
For some reason, ChatGPT sometimes tags HTML as "php" and requires a gentle reminder that we no longer use that technology by choice.