Visual diff tool for Red Hat documentation. Compares Pantheon stage vs preview environments (or PR builds) and generates an HTML report with annotated screenshots highlighting changed regions.
- Python 3.10+
wget(for mirroring documentation sites)- VPN connection to Red Hat network (Pantheon mode)
# First run auto-creates venv and installs dependencies
scripts/visual-diff urlsOr manually:
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
playwright install chromium# List all title URLs
scripts/visual-diff urls --pantheon-version 1.9
# Run visual diff
scripts/visual-diff diff --pantheon-version 1.9 --headless --output /tmp/rhdh-diff/
# Filter by title
scripts/visual-diff diff --pantheon-version 1.9 --title "About" --headlessscripts/visual-diff diff --mode pr --env-a <url-a> --env-b <url-b> --output /tmp/pr-diff/- Mirror both environments with
wget -r -l 2into.cache/mirror/ - Compare text locally (no network) to skip identical pages
- Render changed pages to PNG via headless Chromium (no JS/CSS for speed)
- Diff screenshots with numpy, annotate changed regions with red borders
- Report collapsible HTML with side-by-side comparisons
Copy .env.example to .env and set:
PANTHEON_VERSION=1.9
PANTHEON_PRODUCT=red_hat_developer_hub