Render a site and live-preview it

§ 1Purpose

Get a finished HTML build of a wdoc document, and a watch-rebuild server while you iterate on it.

§ 2Prerequisites

§ 3Flowchart

1. Render to a folder2. Open the output3. Switch to a livepreview

§ 4Steps

§ 4.11

§ 4.2Render to a folder

console
$ wcl wdoc build site.wcl --out out

Render every page block in site.wcl to out/. Each page lands at out/<name>.html; with several sites, each renders into its own out/<name>/ subdirectory with a chooser index.

§ 4.32

§ 4.4Open the output

console
$ ls out
index.html  usage.html

Open out/index.html in a browser to check the rendered result.

§ 4.53

§ 4.6Switch to a live preview

console
$ wcl wdoc serve site.wcl
Serving on http://127.0.0.1:8080

Run wcl wdoc serve to start a dev server that watches the source for .wcl changes and re-renders on each save. Refresh the browser to see updates; pass --addr to change the bind address.

Verification

out/ holds one .html per page, and editing the source under wcl wdoc serve updates the served page after a refresh.