Skip to content

feat(docs): introduce MkDocs Material documentation site - #1129

Merged
Kohei-Wada merged 2 commits into
mainfrom
feat/mkdocs-docs-site
Jul 25, 2026
Merged

feat(docs): introduce MkDocs Material documentation site#1129
Kohei-Wada merged 2 commits into
mainfrom
feat/mkdocs-docs-site

Conversation

@Kohei-Wada

Copy link
Copy Markdown
Owner

Summary

Implements #667: MkDocs + Material documentation site with auto-generated CLI/API references, deployed to GitHub Pages.

Site URL (after merge + Pages enablement): https://kohei-wada.github.io/taskdog/

Changes

  • mkdocs.yml — Material theme with light/dark toggle, search, code copy; nav over the reorganized docs tree
  • CLI reference (docs/reference/cli.md) — auto-generated from the Click command tree via mkdocs-click; adding a command updates the docs with no manual work
  • API reference (docs/reference/api.md) — generated by scripts/generate_openapi_docs.py from create_app().openapi() without starting the server; build-time artifact, gitignored
  • Docs reorganization (git mv, history preserved):
    • QUICKSTART.mdgetting-started.md, CONFIGURATION.mdconfiguration.md, DESIGN_PHILOSOPHY.mddesign-philosophy.md, OPTIMIZATION_ARCHITECTURE.mdoptimization/architecture.md
    • Hand-written COMMANDS.md / API.md kept as reference/cli-guide.md / reference/api-guide.md (curated examples stay valuable next to the generated references)
    • contributing.md includes root CONTRIBUTING.md via pymdownx.snippets
  • Removed manual Table of Contents sections (Material renders a sidebar TOC; the hand-written ones had drifted anchors)
  • Fixed repo-relative links so they resolve both on GitHub and on the site
  • Makefile: docs, docs-api, docs-serve, docs-build targets
  • CI (.github/workflows/docs.yml): mkdocs build --strict on PRs touching docs/src, build + deploy to Pages on main push
  • Docs deps as docs extra on the workspace root (uv run --extra docs), consistent with the uv workspace instead of a separate requirements.txt

Verification

  • mkdocs build --strict: clean (0 warnings)
  • Served locally and reviewed Home / CLI Reference / API Reference pages in a browser
  • ruff check / ruff format on the new script: clean

Post-merge

  • Enable GitHub Pages with build_type=workflow (Actions source), then the docs workflow deploys on push to main

Closes #667

Set up MkDocs + Material with auto-generated references, deployed to
GitHub Pages via Actions:

- mkdocs.yml with Material theme (light/dark toggle, search, code copy)
- CLI reference auto-generated from Click definitions via mkdocs-click
- API reference generated from the FastAPI OpenAPI schema by
  scripts/generate_openapi_docs.py (build-time artifact, gitignored)
- Reorganize docs/ into MkDocs navigation; keep hand-written COMMANDS.md
  and API.md content as CLI/API guides alongside the generated references
- Remove manual Table of Contents sections (Material renders its own)
- Fix repo-relative links to work both on GitHub and the docs site
- Makefile targets: docs, docs-api, docs-serve, docs-build
- .github/workflows/docs.yml: strict build on PRs, deploy on main push

Closes #667

@amazon-q-developer amazon-q-developer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

This PR introduces MkDocs Material documentation with auto-generated CLI/API references and GitHub Pages deployment. The implementation is well-structured and follows best practices for documentation generation.

Critical Issues Found

I've identified 3 critical issues that must be fixed before merge:

  1. Missing workspace package installation - The workflow attempts to import taskdog_server without installing workspace packages first, causing the docs build to fail
  2. Missing error handling - The OpenAPI generation script lacks error handling for app initialization failures
  3. Missing Python version setup - The workflow doesn't explicitly set the Python version, risking inconsistent builds

All issues have actionable code suggestions attached to the relevant lines.

Overall Assessment

Once the critical issues are addressed, this implementation will provide excellent auto-generated documentation with minimal maintenance overhead. The use of build-time generation for API docs and mkdocs-click for CLI reference is a solid approach.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.



def generate() -> str:
schema = create_app().openapi()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛑 Crash Risk: Missing error handling for app initialization. If create_app() fails due to missing configuration or environment variables, the script will crash without providing actionable debugging information. Add try-except block with descriptive error messages to handle potential failures during app creation or schema extraction.

Suggested change
schema = create_app().openapi()
def generate() -> str:
try:
schema = create_app().openapi()
except Exception as e:
raise RuntimeError(
f"Failed to generate OpenAPI schema. Ensure the app can initialize "
f"without external dependencies or set required environment variables. "
f"Error: {e}"
) from e
sections: dict[str, list[str]] = {}
for path, methods in schema["paths"].items():
for method, operation in methods.items():
tag = (operation.get("tags") or ["Other"])[0]
sections.setdefault(tag, []).extend(
_format_operation(path, method, operation)
)
lines = [HEADER]
for tag in sorted(sections):
lines.append(f"## {tag}")
lines.append("")
lines.extend(sections[tag])
return "\n".join(lines).rstrip() + "\n"

Comment thread .github/workflows/docs.yml Outdated
Comment on lines +29 to +35
- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Build docs
run: |
uv run --extra docs python scripts/generate_openapi_docs.py
uv run --extra docs mkdocs build --strict

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛑 Logic Error: Missing package installation step. The script imports taskdog_server.api.app but the workflow doesn't install workspace packages before running the docs generation. Add uv sync or similar to install all workspace packages before the build step, or the import will fail at runtime.

Suggested change
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Build docs
run: |
uv run --extra docs python scripts/generate_openapi_docs.py
uv run --extra docs mkdocs build --strict
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Install workspace packages
run: uv sync --all-packages
- name: Build docs
run: |
uv run --extra docs python scripts/generate_openapi_docs.py
uv run --extra docs mkdocs build --strict

Comment on lines +27 to +30
- uses: actions/checkout@v7

- name: Install uv
uses: astral-sh/setup-uv@v7

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing Python version setup in workflow. The workflow installs uv but doesn't specify which Python version to use. While uv may use a default Python, explicitly setting the Python version ensures consistency with the project's requires-python = ">=3.12" requirement. Add a Python setup step with version 3.12 or later.

Suggested change
- uses: actions/checkout@v7
- name: Install uv
uses: astral-sh/setup-uv@v7
- uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install uv
uses: astral-sh/setup-uv@v7

uv run --extra docs alone does not install workspace members in a fresh
environment, so generate_openapi_docs.py failed to import taskdog_server
in CI.
@Kohei-Wada
Kohei-Wada merged commit 9c6ca91 into main Jul 25, 2026
17 checks passed
@Kohei-Wada
Kohei-Wada deleted the feat/mkdocs-docs-site branch July 25, 2026 01:14
Kohei-Wada added a commit that referenced this pull request Jul 25, 2026
The MkDocs migration (#1129) renamed files under docs/; update README,
CLAUDE.md, and the server package README to the new site URLs and paths.
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.

feat(docs): Introduce MkDocs for automated documentation generation

1 participant