From d9d37deae873c4c1dae43c3917f70adf795031b5 Mon Sep 17 00:00:00 2001 From: David Kerns Date: Mon, 19 Oct 2026 17:11:40 +0200 Subject: [PATCH] Move demo publishing details into the contributor guide --- CONTRIBUTING.md | 40 ++++++++++++++++++++++++++++++++++++++++ README.md | 31 +++---------------------------- 2 files changed, 43 insertions(+), 28 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..1d7f155 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,40 @@ +# Contributing to Dummy + +## Development and verification + +Install development dependencies and run the checks from the repository root: + +```sh +composer install +composer validate --strict +composer lint +composer test +composer audit +``` + +The suite covers legacy helpers, generated lorem and title casing, nested loops and positions, query/path helpers, image cropping/transparency/caching, ads, standalone loading, Laravel publishing and Blade rendering, and the static demo export. The [Tests workflow](.github/workflows/tests.yml) resolves compatible dependencies for PHP 8.3–8.5 with Laravel 12 and 13. + +See [the verification report](docs/verification.md) for tested versions, fresh-project installation results, and coverage limits. + +## Maintaining the hosted demo + +Edit `demo.php` and its assets in `demo_files/`. Preview the PHP demo locally: + +```sh +php -S localhost:8000 +``` + +Open [localhost:8000/demo.php](http://localhost:8000/demo.php). PHP needs the GD extension and write access to `dummy/cache`, or permission to create that directory. + +The [hosted demo](https://kerns.github.io/dummy/) is a static snapshot. PHP runs during the build; the exported site contains HTML, CSS, JavaScript, and the selected images. It includes a note explaining that fresh random content requires running PHP locally. + +Build and preview the static export: + +```sh +composer demo:build +php -S localhost:8001 -t build +``` + +Open [localhost:8001/demo/](http://localhost:8001/demo/). The export also needs the PHP DOM extension. It uses relative resource URLs so it works below a project URL path. + +The [Demo workflow](.github/workflows/demo.yml) rebuilds and publishes the site when demo-related changes reach `master`. It can also be run manually from GitHub Actions. Keep image credits and license files in the exported site when changing the build. diff --git a/README.md b/README.md index 378b400..ace26ff 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ php -S localhost:8000 Open [localhost:8000/demo.php](http://localhost:8000/demo.php). The demo includes installation instructions, working examples, copyable snippets, image thumbnails, and guidance for high-density displays. PHP needs write access to `dummy/cache`, or permission to create that directory. -The hosted demo is a generated snapshot. Running it locally produces fresh random content on every request. +The online examples stay the same between visits. Run the demo locally for fresh random content on each reload. ## Install with Composer @@ -229,34 +229,9 @@ Use `if` with percentages and `while` with counts or ranges. Nested loops keep t `dumb_question('url:mode=compact')` tests query parameters. `dumb_question('segment:1=news')` tests URL path segments, numbered from one. Laravel uses the current request; plain PHP uses `PATH_INFO` or `REQUEST_URI`. The optional legacy Apache rewrite's `dummyurl` parameter is also supported. -## Publishing the demo +## Contributing -GitHub Pages can host a static snapshot of the demo. PHP runs during the build, and the exported site contains HTML, CSS, JavaScript, and the selected images. The page labels itself as a snapshot; live per-request randomization remains available when running PHP locally. - -Build and preview it locally: - -```sh -composer demo:build -php -S localhost:8001 -t build -``` - -Open [localhost:8001/demo/](http://localhost:8001/demo/). The build also needs the PHP DOM extension. It uses relative resource URLs, so it works below a project URL path. - -The [Demo workflow](.github/workflows/demo.yml) rebuilds and publishes [kerns.github.io/dummy](https://kerns.github.io/dummy/) when demo-related changes reach `master`. It can also be run manually from GitHub Actions. - -## Development and verification - -```sh -composer install -composer validate --strict -composer lint -composer test -composer audit -``` - -The suite covers legacy helpers, generated lorem and title casing, nested loops and positions, query/path helpers, image cropping/transparency/caching, ads, standalone loading, Laravel publishing and Blade rendering, and the static demo export. CI resolves compatible dependencies for PHP 8.3–8.5 with Laravel 12 and 13. - -See [the verification report](docs/verification.md) for the tested versions and fresh-project installation results. +See the [contributor guide](CONTRIBUTING.md) for development setup, tests, and demo maintenance. The [verification report](docs/verification.md) lists tested versions and fresh-project installation results. ## License and credits