User Guide System¶
Opens the application user guide in the user's default browser.
Architecture¶
The guide content lives in a separate MkDocs Material site (user_guide_docs/)
and is hosted on Cloudflare Pages. On app startup a background worker downloads
the guide into a local cache so it works offline too.
Cloudflare Pages (gehasoftwarehub-guide)
version.json - current version metadata
guide.zip - full MkDocs site as a zip archive
Local cache (persistent_data/user_guide/)
version.json - cached version metadata
index.html - entry point opened by the browser
... - remaining site files
How It Works¶
- Startup:
MainControllerstartsGuideCacheWorkerin a background thread - Worker: Fetches
version.jsonfrom Cloudflare, compares with local cache - Download: If a newer version exists, downloads
guide.zipand extracts it - Help clicked: Lazy-starts a local HTTP server and opens
http://127.0.0.1:<port>/in the default browser. The server serves from the local cache directory. - No cache yet: Falls back to the Cloudflare URL (requires internet)
The local HTTP server is necessary because browsers block Web Workers and
fetch() on file:// URLs, which would break MkDocs Material search and
theme switching. The server runs in a daemon thread, uses an OS-assigned
port, and is automatically cleaned up on app exit.
Structure¶
user_guide_system/
__init__.py
README.md
constants/
__init__.py
paths.py - PathDef for cache directory and version file
model/
__init__.py
guide_cache_manager.py - File I/O for the local cache
guide_cache_worker.py - QRunnable background worker
guide_server.py - Lazy localhost HTTP server for offline docs
Deploying a New Guide Version¶
- Edit content in
user_guide_docs/docs/ - Bump the version in
user_guide_docs/VERSION - Run
python user_guide_docs/deploy_user_guide.py
The next time the app starts, it will detect the new version and download it.