feat(cli,mkdocs): require site_name, fix nav paths, and echo serve URL

- Require `--site-name` when generating mkdocs.yml to ensure valid configs
- Inject site_name explicitly into generated mkdocs.yml
- Echo MkDocs serve URL (http://127.0.0.1:8000) before starting server
- Fix MkDocs nav emission to correctly resolve docs-relative paths
- Align MkDocs-related optional dependencies with a compatible, pinned set

These changes make MkDocs generation valid by default, improve UX when serving,
and prevent nav path and plugin compatibility issues.
This commit is contained in:
2026-01-21 00:32:29 +05:30
parent 46b7cc52e1
commit 4fa3bc0533
5 changed files with 46 additions and 5 deletions

View File

@@ -25,6 +25,11 @@ def _load_template(template: Path | None) -> dict:
@click.command("mkdocs")
@click.option(
"--site-name",
required=True,
help="MkDocs site_name (required)",
)
@click.option(
"--docs-dir",
type=click.Path(path_type=Path),
@@ -52,6 +57,7 @@ def mkdocs_cmd(
nav_file: Path,
template: Path | None,
out: Path,
site_name: str,
) -> None:
"""Generate mkdocs.yml from nav spec and template."""
@@ -70,6 +76,9 @@ def mkdocs_cmd(
# Load template (user or built-in)
data = _load_template(template)
# Inject site_name
data["site_name"] = site_name
# Inject nav
data["nav"] = nav_block