docs(readme): align variants build/rebuild docs with the current process (rows 239-240)

- Build process: document the naming convention (folder/json respondage_<client>,
  metadata name must equal the file name, title '<Client> LimeSurvey theme',
  e.g. respondage_defensie -> 'Defensie LimeSurvey theme') and the shortcut of
  starting a new variant by copying an existing client json — plus the caution
  that build_all.sh builds EVERY *.json in the definitions dir, so don't run it
  while a copied json is still unadjusted.
- Rebuild process: note that build_all.sh prints a 'N built, M failed' summary,
  exits non-zero on any failure, and that build.php enforces the per-variant
  rules itself (preview.svg first-creation-only + never overwritten,
  identical-preview.png warning).

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Tammo ter Hark 2026-11-30 12:32:46 +01:00
commit 73ee0e887f

View file

@ -377,14 +377,23 @@ the variant's `preview.png` is identical to the mother's.
2. In the private variants repo, create `variants/<client>.json` with the 2. In the private variants repo, create `variants/<client>.json` with the
variant name/title/description and only the house-style option keys with the variant name/title/description and only the house-style option keys with the
client values, plus a `<client>/` asset folder (logos, `files/fonts/`, client values, plus a `<client>/` asset folder (logos, `files/fonts/`,
`css/variant.css`, `files/preview.svg`/`preview.png`): `css/variant.css`, `files/preview.svg`/`preview.png`).
Naming convention: folder/json `respondage_<client>`, metadata `name`
`respondage_<client>` (must equal the file name), `title`
`"<Client> LimeSurvey theme"` (e.g. `respondage_acme` →
"Acme LimeSurvey theme"). Easiest start: copy an existing client json
(`cp respondage_acme.json respondage_<client>.json`), set `name`, and
adjust title/description/options/assets afterwards.
```json ```json
{ {
"name": "respondage_client", "name": "respondage_client",
"title": "Client Vanilla", "title": "Client LimeSurvey theme",
"options": { "primarycolor": "#123456", "fontsize": "18px" } "options": { "primarycolor": "#123456", "fontsize": "18px" }
} }
``` ```
CAUTION: `build_all.sh` (step below) builds EVERY `*.json` in the
definitions dir — do not run it while a just-copied json is still
unadjusted, it would rebuild that variant with the copied values.
3. Run `php variants/build.php <client> <definitions-dir>`. This generates 3. Run `php variants/build.php <client> <definitions-dir>`. This generates
`../<client>/config.xml`: a copy of this theme's config.xml with only those `../<client>/config.xml`: a copy of this theme's config.xml with only those
option values replaced, `<extends>` set to this theme, and the `<engine>` option values replaced, `<extends>` set to this theme, and the `<engine>`
@ -416,9 +425,13 @@ the variant's `preview.png` is identical to the mother's.
``` ```
(`<definitions-dir>` defaults to `variants/` or `$RESPONDAGE_VARIANTS_DIR`; (`<definitions-dir>` defaults to `variants/` or `$RESPONDAGE_VARIANTS_DIR`;
set `PHP_BIN=/path/to/php` if `php` is not on PATH.) It loops over every set `PHP_BIN=/path/to/php` if `php` is not on PATH.) It loops over every
`*.json` in the definitions dir, calls `build.php` per variant, and fails `*.json` in the definitions dir, calls `build.php` per variant, prints a
non-zero if any variant fails. Then, per rebuilt variant: reset the theme in summary (`N built, M failed`) and exits non-zero if any variant fails
the LimeSurvey admin (Theme options → Reset), flush assets, Ctrl+F5. (unknown option keys fail loudly — the drift check). Then, per rebuilt
variant: reset the theme in the LimeSurvey admin (Theme options → Reset),
flush assets, Ctrl+F5. `build.php` enforces the per-variant rules itself:
`files/preview.svg` is only added at first creation and never overwritten,
and it warns when a variant's `preview.png` is identical to the mother's.
Never edit the generated `../<client>/` folder by hand — every build Never edit the generated `../<client>/` folder by hand — every build
OVERWRITES its files from the definitions dir, EXCEPT `files/preview.svg` OVERWRITES its files from the definitions dir, EXCEPT `files/preview.svg`
(first-creation-only, see above). A variant folder that is not rebuilt after (first-creation-only, see above). A variant folder that is not rebuilt after