Appearance
Roadmap
Done
- v0 —
runblocks: build-time Shiki transformer, Web Worker runner with timeout + Stop, streamed console output with a proper serializer, JavaScript only, VitePress adapter. - v0.2 —
run edit: editable overlay, lazy re-highlighting,localStoragepersistence with Reset. - v0.3 (TypeScript) — type annotations stripped in-browser via Sucrase before execution. No type-checking — this only removes syntax that isn't valid JS.
- v0.3 (loader hook) —
registerLanguageLoader/registerThemeLoaderlet a site register a custom Shiki grammar or theme loader so therun editre-highlighter can resolve it, matching what the site's own Shiki config already uses. - v0.4 (plain Astro) — a single
@ugoku/astrointegration: add it tointegrationsinastro.config.mjsand both the Shiki transformer and the client mount/navigation script are wired automatically. Works under Astro's default full-page navigation and under its opt-in<ClientRouter />view transitions. - Unified/rehype passthrough —
ugokuTransformer()works unmodified through@shikijs/rehypein any unified.js pipeline (Next.js MDX, Nextra, Docusaurus), verified by a regression test. No new package needed for the build-time half; readers wire their own client-sidemount()call, same as the "Other unified.js sites" guide section covers.
In progress / next up
Later
- Eleventy /
markdown-itsupport — Eleventy's default markdown engine ismarkdown-it, not rehype, so the unified/rehype passthrough above doesn't reach it. Would need its own integration against something like@shikijs/markdown-it. - Astro Starlight support (
@ugoku/expressive-code) — Starlight replaces Shiki with its own highlighter (Expressive Code), so this needs real adapter work rather than just wiring config, unlike the plain Astro adapter above. - Language plugins (e.g. Pyodide) as lazy-loaded opt-ins — never bundled into core. Plugin shape:
run(code) → stream of output events.
Known limitations
- Decorations from other Shiki transformers (line highlight, diff, focus, line numbers) can't be re-applied client-side — on first edit they're dropped and tokens re-rendered.
- Twoslash is supported with
run, not withrun edit. - Output is console-only — no DOM/iframe rendering, so this fits logic/algorithm examples, not UI demos.