Preview server
The preview server renders your project as a navigable HTML site so you can review content formatting and structure before publishing. It’s a local development tool — nothing is deployed or shared.
Preview is optional. You can author and publish a project without ever running it. It’s most useful when you’re writing content files and want to see how they render, or when you want to check that callouts, images, and markdown formatting look right.
Launching the server
Run the preview server in a terminal. Press Ctrl+C to stop it.
uvx genlabz-preview <project_id>Replace <project_id> with your project’s kebab-case identifier (e.g. s3-static-website). The server starts at http://localhost:8080 and opens in your browser automatically.
Site structure
The preview server renders five page types:
| Route | What it shows |
|---|---|
/ | Overview page — project title, summary, learning outcomes, difficulty, duration, prerequisites, references, and the resolved overview content |
/objectives | Objectives listing — all objectives with their titles and resolved descriptions |
/objectives/{id} | Objective detail — the objective’s narrative content and a list of its steps |
/objectives/{id}/{step_id} | Step detail — step title, resolved content, and a table of input and output handles |
/images/{path} | Static image files from the images/ directory |
“Resolved content” means the content file wins over the spec field when both exist. The preview server applies the same resolution rule as the rest of the platform — if content/overview.md exists, the overview page shows that file’s content rather than the overview field from spec.yaml.
Live reload
The server watches three locations for changes:
content/— any content file added, edited, or deletedspec.yaml— any change to the project definitionimages/— any image added or removed
When a watched file changes, the browser reloads automatically. There’s no need to restart the server or manually refresh.
Callout rendering
The preview server renders the four supported callout types with colour-coded styling:
| Callout | Colour |
|---|---|
NOTE | Blue |
TIP | Green |
WARNING | Amber |
IMPORTANT | Red |
An unrecognised callout type (anything other than NOTE, TIP, WARNING, IMPORTANT) won’t render as a callout — it will appear as plain text. The review_project tool reports an INVALID_CALLOUT_TYPE warning for these cases.
Stopping the server
Press Ctrl+C in the terminal where the server is running. The server does not run in the background — closing the terminal also stops it.