RMGui 0.15.0
C11 retained-mode UI library: layout kernel, style schema, widget painters, fonts, software framebuffer
Loading...
Searching...
No Matches
Building the project site

The project site is static. Assemble a release copy with sh, awk, make, Doxygen, Python 3 with FontTools (python3-fonttools on Debian and Ubuntu), tar, sha256sum and Emscripten 6.0.9 (emcc on PATH). Download these two archives from the v0.14.4 release:

  • rmgui-0.14.4-showcase-web-febeb3f319b7.tar.gz, for the full showcase.
  • rmgui-0.14.4-wasm-febeb3f319b7.tar.gz, for the specimens and Reward HUD.

From the repository root, with the two archives in the current directory:

sh docs/site/build.sh rmgui-0.14.4-showcase-web-febeb3f319b7.tar.gz \
rmgui-0.14.4-wasm-febeb3f319b7.tar.gz /tmp/rmgui-site

The destination must not exist. The script generates the API reference from the checkout's public headers, verifies the published archive digests, copies the unmodified web showcase and links the homepage specimens and Reward HUD against the released Wasm archive. It does not build the library or deploy. Use a private Emscripten cache (EM_CACHE) when building on a shared machine.

Preview from source

To assemble and serve the site locally from source without downloading release archives:

make wasm showcase-web
sh docs/site/build.sh --preview build/site
python3 -m http.server 8080 --bind 127.0.0.1 --directory build/site

The preview uses the checkout's docs and browser demos. The homepage's package links still point to the pinned public release.

Serve the assembled site

Point the static host's document root at the entire output directory, not showcase/.

Request File relative to the document root
/ index.html (project homepage and downloads)
/docs/ docs/index.html (Doxygen reference)
/showcase/ showcase/index.html (released WebAssembly showcase)
/reward-hud/ reward-hud/index.html (standalone demo with live repaint counters)
/reward-hud.tar.gz Downloadable C11 example, build instructions and replay trace
/showcase/?page=2 Same showcase entry point with the Slider page selected

Use normal directory indexes. Redirect /showcase, /reward-hud and /docs to their slash-terminated paths, preserving query strings. The showcase, homepage specimens and Reward HUD load JS and Wasm from their own directories. Serve .mjs as JavaScript and .wasm as application/wasm. Return 404 for missing assets rather than serving the homepage as a fallback. The site uses relative links so the same directory can also be served under a path prefix ending in /.

On a host that previously served the showcase at /, replace the root with this site. Do not redirect / to the showcase. If old asset URLs need to be retained, redirect only explicitly chosen legacy paths to their counterparts under /showcase/.

The homepage displays and compiles the same C snippets as Four small RMGui examples. The four specimens and numbered, highlighted source views share one Wasm module and subsetted fonts. The browser loads them and the Reward HUD only as they enter the viewport. The code canvas rasterizes text at the browser's device-pixel ratio, with RMGui scrollbars for overflow and a fixed line-number gutter. Drag or use Shift with the arrow keys to select. Copy text in the context menu copies the selection, or the whole snippet when there is no selection. Ctrl+C and Command+C copy just the selection. Copies omit line numbers. The canvas does not require the async Clipboard or Popover APIs. Browsers that cannot run Wasm or Canvas retain selectable HTML. If someone starts using the HTML source while the canvas loads, the upgrade waits until they leave the source and clear the selection. The chart inspects samples. The rich-text specimen loads hamlet.md on demand and demonstrates text selection, a draggable scrollbar, and a link. Its snippet receives the loaded UTF-8 document as a pointer and byte count. The demos repaint on input, resize, or HUD motion, never at rest. The build caps the combined demo payload at 512 KiB uncompressed. The standalone HUD uses the same browser host and adds repaint counters.

Exercise the assembled homepage in Chrome with Node 24:

node tests/site_codeblock.cjs /tmp/rmgui-site "$CHROMIUM"

The test checks pointer selection and clipboard contents with and without the async Clipboard API, including when it denies the write.

Refresh example images

The gallery images show only the example output. To rerender them with the same snippet source, unpack the native archive and run:

sh docs/examples/render.sh /path/to/extracted-native-package /tmp/rmgui-captures

The command compiles the guide snippets and docs/examples/*.inc samples against the released archive, using the bundled Noto fonts. Review the two gallery clips and seven guide PNGs before replacing them in docs/guides/images/. For meters.png, follow Getting started.

The Reward HUD clip uses its own trace, not the showcase. See docs/examples/reward-hud/README.md (also in the site download) to build the example, regenerate the clip or reproduce an individual frame.

After every release, pin the docs and the site to it so they follow the latest published version: run sh tools/pin-release.sh vX.Y.Z (it downloads the release's SHA256SUMS, rewrites the README, guides and site pages, and replaces docs/site/release.env and docs/site/release.sums), then update content and demo page numbers. make docs runs tools/check-release-pins.sh and fails when any pin disagrees with release.env. Do not commit Doxygen HTML, extracted packages or assembled site files.

Build the typed-controls mixer

docs/examples/widget-pilot.c uses the installed <rmgui/ui.h> API from this checkout. Build it against the checkout's native archive:

make native
cc -std=c11 -Ibuild/native/include \
docs/examples/widget-pilot.c build/native/librmgui.a \
build/native/libckdl.a -lm -o /tmp/rmgui-controls
/tmp/rmgui-controls assets/fonts/NotoSans-Regular.ttf > /tmp/controls.rgba
magick -size 360x120 -depth 8 rgba:/tmp/controls.rgba /tmp/controls.png

The four controls keep their input state next to their labels or detents. The host supplies the boxes, routes focus and capture, and responds to activation. The mixer resets gain on button activation and changes pan on a pointer drag without a widget registry or retained paint context.

For a recorded target, call rmgui_button_prepare for each labelled button before recording any commands, then call the same draw functions used for CPU painting. Sliders do not need glyph preparation. See the typed elements guide for the same paint context with other widgets. The homepage snippets and embedded showcase still use the pinned public release.