5 Commits
Author SHA1 Message Date
Jan De DobbeleerandJan De Dobbeleer f6793cbedc fix(svg): change studio render based on mode
Entire-Checkpoint: 642cd14ce7ad
2026-07-30 19:44:41 +02:00
Jan De DobbeleerandJan De Dobbeleer 267f672b96 fix(svg): render colors correctly
Entire-Checkpoint: f00095ed9b98
2026-07-30 19:44:41 +02:00
48d6685d85 feat(website): live-reload themes and wasm during local dev
`npm start` now runs scripts/dev.mjs instead of `docusaurus start`
directly. It wraps the dev server with watchers that keep generated
artifacts current without a manual regen + restart:

- a /themes edit re-renders just that theme and patches it into
  generated/themes.json, so <ThemeGallery/> hot-reloads it
- editing export_themes.mjs, font-metrics.mjs or segment_data.json
  falls back to a full `npm run themes`, since those can change
  every theme`s render
- editing a Go source file under src/ rebuilds the studio`s wasm
  module (`npm run wasm`)

`npm run build` and CI are unaffected: they already run these
scripts explicitly before building and never watch anything.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Entire-Checkpoint: 23a2e79bf51a
2026-07-30 19:44:41 +02:00
Jan De DobbeleerandJan De Dobbeleer 5c83ffad5e feat(website): render the site's artifacts without spawning the CLI
The gallery spawns oh-my-posh once per theme and the segment previews
once per segment: 241 processes to draw pictures the studio already
draws in a browser tab, from the same render.SVG.

A Node module instantiates that same wasm once and renders every prompt
in-process. It also decides what the SVG encoder has to stay reachable
from: with this, nothing outside the module needs to draw one.

Two things it needed. An empty config now means the built-in default,
matching what config.Load does with no path, so the homepage can ask for
the prompt someone sees before configuring anything - there is no file
to point at and no bundled theme that matches it. And the data fixture
carries what a template calls as well as what it reads, re-recorded
through the writers so its curated values survive.

The generators still shell out to the CLI. Rendering all 124 themes
through the module leaves 16 whose templates fail against the fixture,
and that is not understood yet - the keys those templates name are all
present. Switching them over waits on that.

Entire-Checkpoint: b83e4917be12
2026-07-30 19:44:41 +02:00
Jan De DobbeleerandJan De Dobbeleer 585f50ae88 feat(website): rebuild the docs around a catalog and a studio
The site asked visitors to read a wall of segment pages to find out
what oh-my-posh could do, and to install it before seeing a prompt.

The homepage now leads with the install command and a rendered prompt.
Every one of the 117 segments is in a searchable catalog generated from
the docs themselves, so it cannot drift from what ships, and each
segment page carries a preview rendered from committed sample data at
build time. The theme gallery inlines the SVGs from the previous
commits instead of loading screenshots.

The studio renders a config live in the browser through the wasm
module, and each segment page embeds the same editor: change the
sample config, watch the prompt redraw, then send the segment to the
studio to build a full theme out of it. Nothing is sent anywhere.

The docs move into one shell around all of it, on a single type and
spacing scale, with a filterable sidebar.

Entire-Checkpoint: dc6fc3bdbdf2
2026-07-30 19:44:41 +02:00