Skip to content
For technical writers and developer educators

Technical articles with code that runs in the page

Tutorials usually send readers off to a sandbox on another site. On ModelPad the project sits beside the text: a three.js scene, a React component or a shader that readers can edit and watch change. The page is server-rendered HTML with the code already highlighted, so it loads fast and search engines read all of it.

New accounts are approved before they open. Playgrounds are in the advanced workspace, one switch away in Settings.

The ModelPad playground editor: a file tree with src/main.js, index.html, package.json and styles.css, the three.js source with line numbers, and a live ray-traced black hole in the preview pane with Light bending, Doppler beaming and Disk toggles
A live playground

Scene Dreamer, published from a project folder with one command

This is a full-screen three.js project hosted on ModelPad. Press the button and it loads here, in this page. The playground itself doesn't download until you ask for it.

Scene Dreamer: a pastel 1980s beach-house room with a ceiling fan, rattan chairs, a boombox and a view of the sea
Stylised 80s rooms (a beach house, Tokyo, a boardroom, a graveyard) with day and night and ambient sound. It lives in a local folder and went up with modelpad playgrounds publish <dir>. Open full screen
Interactive figures

A ray-traced black hole in the middle of an article

Turing Registry, a science publication run by the person who builds ModelPad, explains what a black hole looks like with a figure the reader can move.

The picture is computed live in the reader's browser, one light ray per pixel. Drag to look from another angle; switch off light bending to see the scene as if light travelled in straight lines. Further down, a second figure traces individual rays round the hole, with a slider for the impact parameter and the deflection angle read out as you move it.

Both figures are playgrounds shown preview-only, so they sit in the article like any diagram, with the article's own typography around them.

A Turing Registry article in a monospace theme: a paragraph explaining that the picture is computed live, one light ray per pixel, above the black hole figure with its glowing, bent accretion disk
The light-ray diagram: rays bending round the event horizon and photon sphere, with an impact parameter slider set to b = 3.000 and a readout of deflected 98.5 degrees
The light-ray figure from the same article. Rays with an impact parameter under 2.598 Schwarzschild radii fall in; the highlighted one at b = 3.000 is deflected 98.5°.
Playgrounds

Multi-file web projects that run in the browser

A playground is a small project with real files. You write it in the editor in ModelPad or in your own editor, and it bundles and runs in the reader's browser.

Several files, real imports

index.html, a src folder, styles and a package.json. Plain JavaScript, three.js and React projects all work, and packages from npm install by name.

Models, textures and data

Static files such as glTF models, images and JSON data are served alongside the code, so a scene can load its assets by path.

Code beside a live preview

Place one in an article with file tabs on one side and the running result on the other. Readers can edit the code and the preview follows.

Preview only, as a figure

Hide the code when the point is the result. The black hole above is shown this way, captioned and sized like an illustration.

Full screen at its own address

Publish a playground on its own at modelpad.app/u/<account>/play/<slug>, like Scene Dreamer. A share image is taken automatically for link previews.

Push and pull from your machine

The CLI uploads a local folder as a playground, publishes it, and pulls it back down. Pushing the same folder again updates the same playground.

Tutorials on Code Workshop

Code Workshop, also by the person who builds ModelPad, publishes React Three Fiber tutorials at codeworkshop.dev. Each lesson puts an editable playground under the explanation: the reader sees the whole project, file by file, and can change it and watch the model respond.

The article shown adds OrbitControls to a React Three Fiber scene without the drei helpers, with package.json, index.html, styles and the React source in tabs.

Code Workshop article titled Adding OrbitControls to React Three Fiber, with an intro paragraph and a playground below it showing file tabs and React code
A Code Workshop playground: tabs for package.json, index.html, src/styles.css, src/index.js and src/App.js, React Three Fiber source on the left and a 3D model rendering on the right
The same playground up close: five files in tabs, the source on the left, the running scene on the right.
Code blocks

Syntax highlighting done on the server

Code blocks are coloured when the page renders, before it leaves the server.

  • Readers get highlighted code in the HTML itself, with no highlighting script to download and no flash of plain text while one runs.
  • It works in every site theme, light or dark, monospace or serif.
  • In the editors you write against the Dracula theme, with line numbers.
  • Code stays as text in the page, so readers can select and copy it and search engines can index it.
The ModelPad article editor with a contents outline on the left and two highlighted code blocks: a GLSL blackbody function under the heading Colouring the disk, and a JavaScript frame loop under Driving it from JavaScript
From the black hole article, GLSL
// Disk colour from gas temperature (Tanner Helland's fit)
vec3 blackbody(float t) {
  t = clamp(t, 800.0, 40000.0) / 100.0;
  float r = t <= 66.0 ? 1.0
    : clamp(1.29293618 * pow(t - 60.0, -0.1332047592), 0.0, 1.0);
  float g = t <= 66.0
    ? clamp(0.39008157876 * log(t) - 0.63184144378, 0.0, 1.0)
    : clamp(1.12989086089 * pow(t - 60.0, -0.0755148492), 0.0, 1.0);
  float b = t >= 66.0 ? 1.0 : (t <= 19.0 ? 0.0
    : clamp(0.54320678911 * log(t - 10.0) - 1.19625408914, 0.0, 1.0));
  return pow(vec3(r, g, b), vec3(2.2));
}
Published on codeworkshop.dev
A server-highlighted code block on Code Workshop: imports from react, react-three-fiber and three, then a commented extend call for OrbitControls
A highlighted block as readers receive it: coloured in the HTML, no script involved.
Writing and publishing

A long-form editor and a publishing pipeline that handles SEO

The playgrounds sit inside articles, so the writing tools matter as much. Articles, readers, sign-ups and sales are linked records in one account, so each article carries its own numbers, and modelpad sites content-stats lists them all for you or your agent.

Long-form editor

Headings with a contents outline, code blocks and images. Articles are filed in folders and tagged with the site's taxonomy, and they publish as you wrote them.

Markdown in and out

Create or replace an article from a markdown file and read any article back as markdown. Import a folder of markdown or MDX with frontmatter; slugs and dates are kept.

Structured blocks

Timelines, charts, stats, pros and cons, comparisons, maps and playgrounds, each written in markdown with a short syntax. modelpad notes dsl prints a working example of each.

Style rules and lint

Write the site's rules into its brief and check articles against them, along with a list of common AI writing tropes. A style error stops publishing until it is fixed or overridden with a reason.

Scheduled publishing

Set a publish time on an article, or on a whole changeset of edits. New articles are sent to search engines through IndexNow when they go live.

SEO handled in the HTML

Server-rendered pages with schema.org structured data, sitemaps, an RSS feed per site and a share image drawn for every article. Search Console can be connected for queries and rankings.

Analytics on what was read

Cookieless traffic analytics per article: what was actually read and where readers came from. You can also A/B test an article's title, with reads as the goal.

Paid or free

Any article can be free, need a free sign-up, be bought once or belong to a subscription tier. The paywall cuts where you put it, and the free part stays indexed.

AI on your own hardware

Point the advanced workspace's AI at a model you host with LM Studio, Ollama or any OpenAI-compatible server, so its requests run on your own hardware.

The CLI

Write in your own editor, keep it in git, publish from the terminal

The modelpad CLI reads markdown files and project folders from disk, so your repo stays the source of the article and its demo.

  • Articles go up from a markdown file and come back as markdown with --as-markdown.
  • Playground folders push, publish and pull. Re-pushing a folder updates the same playground.
  • modelpad check opens pages in Chrome in light and dark, desktop and phone widths, takes screenshots, and reports low-contrast, overlapping, clipped or overflowing text and broken images.
  • Output is JSON on stdout, ready for jq or a script.
~/writing/black-hole
# one-time: authorize this machine in the browser
$ modelpad auth login

# the article, from a markdown file in the repo
$ modelpad notes create --title "Ray tracing a black hole in a fragment shader" --markdown post.md

# the demo folder becomes a playground (re-push to update it)
$ modelpad playgrounds push ./demo

# and gets its own full-screen address with a share image
$ modelpad playgrounds publish ./demo --slug black-hole

# or goes on a page as a code demo block
$ modelpad playgrounds add-to-page ./demo home

# render the live article in Chrome and report layout problems
$ modelpad check https://turingregistry.net/doc/what-a-black-hole-looks-like-ray-traced --widths 1280,390 --modes light,dark

# pull the playground back into another checkout
$ modelpad playgrounds pull <id> ./demo
Agents

Let Claude Code push, check and stage your work for you to review

Give your coding agent an API key and run modelpad skill install. Claude Code gets a full guide to the account and can publish the article you wrote, push its playground and lint it against your style rules.

  • Its edits can go into a changeset: staged, diffed field by field, and previewed on the real site before you publish them all at once or throw them away.
  • Each agent has its own API key, listed in one place and revocable on its own.
  • History records every change with who made it, you, the in-app assistant or which key, and any change can be undone.
  • Codex, Cursor or your own scripts can use the same CLI, the REST API documented at /docs/api, or the MCP server.
staging an agent's work
# give Claude Code the guide to your account
$ modelpad skill install

# edits from here on are staged, not live
$ modelpad changes start "Shader tutorial, part 2"

# check the article against the site's style rules
$ modelpad notes lint --query group=style

# what changed, and preview links on the real site
$ modelpad changes diff
$ modelpad changes urls

# render-check the preview, then publish all of it
$ modelpad changes check
$ modelpad changes publish

# a week later: see who changed what, undo one change
$ modelpad history since=7d
$ modelpad history undo <n>

Questions technical writers ask

What can a playground run?

Browser projects in plain JavaScript, three.js or React, with packages installed from npm and static files (models, textures, images, data) served next to the code. The project is bundled and run in the reader's browser; there is no server-side runtime behind it.

Can readers edit and run the code?

Yes, when you place a playground with its code showing: the files appear in tabs beside the live preview, and readers can edit them and see the result. If you only want the result, show the playground preview-only and it behaves like an interactive figure.

Is it fast enough to rank in search?

Articles are rendered on the server as real HTML, with code blocks already highlighted, so the text and code are in the page that search engines fetch. Each page carries schema.org structured data, sites have sitemaps and RSS feeds, and new articles are sent to IndexNow when they publish. modelpad schema <url> shows what a page declares and which search features it is missing.

Can I keep my content in git?

Yes. Keep articles as markdown and demos as project folders in your repo, and publish with notes create / notes update --markdown and playgrounds push. Moving an existing blog in, notes import <dir> reads markdown or MDX with frontmatter, uploads the images and keeps your slugs and dates.

Can I export everything?

Any article comes back as markdown with --as-markdown, any playground comes back as a folder with playgrounds pull, and the REST API at /docs/api reads everything else in the account as JSON.

Can an agent publish something I haven't checked?

Not if it works inside a changeset: its edits stay staged until you publish them, and you can preview them on the real site first. History records every change with the key that made it and can undo any of them, and each agent's key can be revoked on its own.

Where are playgrounds in the app?

In the advanced workspace. New accounts open in the simple workspace, which is aimed at shop and small-business owners; switch to advanced in Settings and you get the tabbed workspace with notes, playgrounds, media, pages and themes.

What does it cost to use the AI?

In-app AI runs on credits. Every account starts with 100 free credits, a typical request costs about one, and more come in packs, with a 20% bonus on your first top-up. If you point the AI at a model you host yourself (LM Studio, Ollama or an OpenAI-compatible server), it runs on your own hardware.

Publish your next tutorial with the demo inside it

Request an account, switch to the advanced workspace, and push your first playground from the folder it already lives in.