Skip to content

docs: replace hardcoded jdav-hd.de domain with configured django.host in Sphinx docs#282

Open
chrisflav wants to merge 4 commits intochrisflav:mainfrom
chrisflav-agents:feature/replace-hardcoded-domain-in-docs
Open

docs: replace hardcoded jdav-hd.de domain with configured django.host in Sphinx docs#282
chrisflav wants to merge 4 commits intochrisflav:mainfrom
chrisflav-agents:feature/replace-hardcoded-domain-in-docs

Conversation

@chrisflav
Copy link
Copy Markdown
Owner

Summary

  • Adds a source-read Sphinx event handler in docs/source/conf.py that replaces the hardcoded jdav-hd.de placeholder domain in all RST files at build time
  • The replacement domain is read from django.host in settings.toml (with django.base_url as fallback), respecting the KOMPASS_CONFIG_DIR_PATH/KOMPASS_SETTINGS_FILE environment variables used by the Django app
  • Falls back to deploy/config/settings.toml if no environment-based config is found; no replacement occurs if neither source is available
  • No RST files need to be modified — the substitution happens transparently during the Sphinx build

Closes #240

Test plan

  • Build the Sphinx docs (make html in docs/) and verify all links in the HTML output use the host from settings.toml instead of jdav-hd.de
  • Set KOMPASS_CONFIG_DIR_PATH to a directory with a custom settings.toml and confirm the configured host is used
  • Build without any settings.toml present and confirm the build still succeeds (links remain unchanged)

🤖 Generated with Claude Code

…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>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 3, 2026

📚 Documentation: https://chrisflav.github.io/kompass/feature/replace-hardcoded-domain-in-docs/

Docker Images:

  • App: ghcr.io/chrisflav/kompass:pr-282
  • Nginx: ghcr.io/chrisflav/kompass-nginx:pr-282

Add the awaiting-deployment label to deploy this PR to a staging server.

@chrisflav
Copy link
Copy Markdown
Owner Author

orchestra address review: Make the placeholder domain something generic, say placeholder-domain.de and use it everywhere instead of the jdav-hd.de domain.

…domain

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread docs/source/user_manual/index.rst
@chrisflav
Copy link
Copy Markdown
Owner Author

Replace the https://placeholder-domain.de by a BASE_URL. Then in the substitution pass, replace BASE_URL by protocol://host where protocol is the django.protocol setting (falling back to https) and host is the django.host setting (falling back to django.base_url).

@chrisflav
Copy link
Copy Markdown
Owner Author

Currently, the development server does not serve the documentation pages. Fix that, so that the docs can also be inspected locally under /static/docs.

@chrisflav
Copy link
Copy Markdown
Owner Author

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>
@chrisflav
Copy link
Copy Markdown
Owner Author

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

User Documentation wrong links

1 participant