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
- A WCL file declaring at least one page block
- A wcl CLI on your PATH
§ 3Flowchart
§ 4Steps
§ 4.11
§ 4.2Render to a folder
$ 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
$ 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
$ 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.