docs: replace hardcoded jdav-hd.de domain with configured django.host in Sphinx docs#282
Conversation
…settings.toml Registers a Sphinx source-read event handler that substitutes the placeholder domain with the value from django.host (or django.base_url as fallback) read from the project's settings.toml at build time. Settings are resolved via KOMPASS_CONFIG_DIR_PATH/KOMPASS_SETTINGS_FILE env vars, falling back to the deploy/config/settings.toml example. Closes chrisflav#240 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
📚 Documentation: https://chrisflav.github.io/kompass/feature/replace-hardcoded-domain-in-docs/ Docker Images:
Add the |
|
orchestra address review: Make the placeholder domain something generic, say |
…domain Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Replace the |
|
Currently, the development server does not serve the documentation pages. Fix that, so that the docs can also be inspected locally under |
|
orchestra address review |
…il config The feedback section in the user manual referenced a hardcoded placeholder email. Now the actual address is read from section.digital_mail (falling back to section.responsible_mail) in settings.toml, consistent with how the domain placeholder is already handled. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
orchestra address review: Implement the changes suggested in the comments above, the previous review ignored them. |
- Replace `https://placeholder-domain.de` placeholder in RST files with `BASE_URL`, which is substituted at Sphinx build time with `{protocol}://{host}` (protocol from `django.protocol`, falling back to `https`; host from `django.host` / `django.base_url`) - Rename `_get_kompass_host` → `_get_base_url` in conf.py and include the protocol in the constructed URL - Add the Sphinx HTML output directory to `STATICFILES_DIRS` under the `docs` prefix so the dev server serves docs at `/static/docs/`; the entry is omitted when the build output does not yet exist - Update `make dev docs` message to point to the local server URL Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
source-readSphinx event handler indocs/source/conf.pythat replaces the hardcodedjdav-hd.deplaceholder domain in all RST files at build timedjango.hostinsettings.toml(withdjango.base_urlas fallback), respecting theKOMPASS_CONFIG_DIR_PATH/KOMPASS_SETTINGS_FILEenvironment variables used by the Django appdeploy/config/settings.tomlif no environment-based config is found; no replacement occurs if neither source is availableCloses #240
Test plan
make htmlindocs/) and verify all links in the HTML output use the host fromsettings.tomlinstead ofjdav-hd.deKOMPASS_CONFIG_DIR_PATHto a directory with a customsettings.tomland confirm the configured host is usedsettings.tomlpresent and confirm the build still succeeds (links remain unchanged)🤖 Generated with Claude Code