Source code for ferrosoft.apps.ferrobase.services.help
# Copyright (c) 2025 Ferrosoft GmbH. All rights reserved.
from urllib.parse import urljoin
from ferrosoft.config import require_settings
[docs]
def get_help_url(topic: str) -> str:
"""Build a context-help URL by appending ``#topic`` to the configured base.
Args:
topic: Help anchor name to navigate to within the help site.
Returns:
str: Absolute URL pointing at the topic.
Raises:
Exception: Propagates from :func:`require_settings` when the
``FERROBASE_HELP_BASE_URL`` setting is missing.
"""
settings = require_settings("FERROBASE_HELP_BASE_URL")
return urljoin(settings["FERROBASE_HELP_BASE_URL"], f"#{topic}")