Recording as GIF ================ Guidestar demos can be recorded as animated GIFs for use in contexts that don't support JavaScript — such as Confluence, README files, or slide decks. The recording is performed by a headless browser that plays back the demo and captures frames, then assembles them into a looping GIF. From a Wireframe ---------------- The ``examples/record.py`` script opens each built demo page in headless Chromium, captures frames during one full playback cycle, and assembles them into an animated GIF. Playback controls are hidden during recording. How it works ^^^^^^^^^^^^ 1. **Wireframes** are authored once in ``examples/wireframes/`` — these are the layout and styling for your demo UI. 2. **Demo configs** live in ``examples/demos/`` as JSON files. Each config references a wireframe and defines the step sequence: .. code-block:: json { "wireframe": "kitchen-sink.html", "title": "Kitchen Sink — All Built-in Actions", "steps": [ "#btn-sidebar@1800:click", "#sidebar@800:toggle-class=open", "#input-search@1500:set-value=pipeline" ], "repeat": true, "height": "420px" } Multiple configs can reference the **same wireframe** with different step sequences. 3. **A build script** (``examples/build.py``) combines each config with its wireframe and inlines the controller JS and CSS into a single self-contained HTML page. 4. **The recording script** (``examples/record.py``) plays each page and produces a GIF. Running locally ^^^^^^^^^^^^^^^ .. code-block:: bash # Build self-contained HTML pages python examples/build.py # Record animated GIFs (requires: pip install playwright Pillow # and: playwright install chromium) python examples/record.py # Check the output ls _site/*.html _site/*.gif Recording options ^^^^^^^^^^^^^^^^^ .. code-block:: bash python examples/record.py --fps 10 --width 800 # defaults python examples/record.py --demo kitchen-sink-full # one demo only python examples/record.py --site _site --out _site # custom dirs Higher ``--fps`` produces smoother GIFs but larger files. The default of 10 fps is a good balance. Demo config reference ^^^^^^^^^^^^^^^^^^^^^ .. list-table:: :widths: 20 15 65 :header-rows: 1 * - Key - Default - Description * - ``wireframe`` - (required) - Filename of the wireframe HTML in ``examples/wireframes/`` * - ``title`` - ``"Wireframe Demo"`` - Page ``