Conversation
Implements a static documentation website using MkDocs that automatically splits README.md into multiple pages based on level 2 headings. The site is deployed to GitHub Pages via GitHub Actions on every merge to main. Closes kortex-hub#95 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Signed-off-by: Philippe Martin <phmartin@redhat.com>
The git-revision-date-localized plugin was generating warnings in strict mode because the dynamically generated markdown files have no git history. Since we split README.md at build time, revision dates for individual pages don't make sense anyway. Signed-off-by: Philippe Martin <phmartin@redhat.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
📝 WalkthroughWalkthroughAdds a MkDocs-based documentation site with a hook that splits Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer (push / workflow_dispatch)
participant GH as GitHub Actions Runner
participant Repo as Repository
participant Build as Build job (ubuntu-24.04)
participant Artifact as Actions Upload Artifact
participant Deploy as Deploy job (actions/deploy-pages)
participant Pages as GitHub Pages
Dev->>GH: trigger workflow
GH->>Repo: checkout
GH->>Build: start build job
Build->>Repo: read README.md, website/hooks.py, website/mkdocs.yml
Build->>Build: setup Python 3.12, install deps
Build->>Build: mkdocs build --strict --verbose (hooks split README -> docs/*.md)
Build->>Artifact: upload ./website/site artifact
Artifact->>Deploy: artifact available
GH->>Deploy: start deploy job (env: github-pages)
Deploy->>Pages: actions/deploy-pages -> publish artifact
Pages-->>Dev: pages URL (deployment output)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
website/mkdocs.yml (1)
26-26: Consider removing or adjustingedit_urifor generated content.Since documentation pages are dynamically generated from
README.mdbyhooks.py, the edit links will point to non-existent files (e.g.,edit/main/installation.md). Consider either:
- Removing
edit_urito disable edit links, or- Setting it to point to the README:
edit_uri: blob/main/README.md🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@website/mkdocs.yml` at line 26, The mkdocs configuration sets edit_uri: edit/main/ which creates edit links for generated pages that don't exist; update mkdocs.yml to either remove the edit_uri entry entirely to disable edit links, or change it to point to the actual source README used by hooks.py (e.g., set edit_uri to blob/main/README.md) so generated pages resolve to README.md; check hooks.py and the generated filenames (like installation.md) to ensure the chosen edit_uri maps to a real repo path.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@website/hooks.py`:
- Around line 160-164: The README lookup in on_nav uses a different path
calculation than on_files, causing misses for relative docs_dir; update the
readme_path calculation in the on_nav function to mirror on_files by resolving
the docs_dir before walking up directories (e.g., use
Path(config['docs_dir']).resolve().parent.parent / 'README.md' instead of
Path(config['docs_dir']).parent / 'README.md') so readme_path consistently
points to the repository root README.md and preserves the existing not-exists
early return.
- Around line 76-86: When building sections in hooks.py (inside the block that
creates current_section using title = line[3:].strip() and slug =
slugify(title)), detect duplicate slugs by tracking seen slugs (e.g., a set or
dict keyed by slug) and if a slug is already present, append a numeric suffix
(slug-2, slug-3, etc.) to produce a unique slug before assigning
current_section['slug'] and appending to sections; update the tracker for each
generated unique slug so subsequent duplicates get incremented suffixes.
In `@website/requirements.txt`:
- Around line 27-28: The requirements file pins vulnerable versions of pillow
and cairosvg; update the entries for pillow and cairosvg in
website/requirements.txt by changing the pinned versions from pillow==11.1.0 to
pillow==12.1.1 and from cairosvg==2.7.1 to cairosvg==2.9.0, then run your
dependency installer/lock regen (e.g., pip install -r requirements.txt / update
lockfile) and run tests to ensure nothing breaks.
---
Nitpick comments:
In `@website/mkdocs.yml`:
- Line 26: The mkdocs configuration sets edit_uri: edit/main/ which creates edit
links for generated pages that don't exist; update mkdocs.yml to either remove
the edit_uri entry entirely to disable edit links, or change it to point to the
actual source README used by hooks.py (e.g., set edit_uri to
blob/main/README.md) so generated pages resolve to README.md; check hooks.py and
the generated filenames (like installation.md) to ensure the chosen edit_uri
maps to a real repo path.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 7730efe8-4bff-4c99-a0f0-846cfb33f771
📒 Files selected for processing (7)
.github/workflows/deploy-docs.yml.gitignorewebsite/WEBSITE.mdwebsite/docs/.gitkeepwebsite/hooks.pywebsite/mkdocs.ymlwebsite/requirements.txt
The on_nav function was using a different path calculation than on_files, which could cause it to fail finding README.md in some scenarios. Now both functions use the same resolved path calculation for consistency. Signed-off-by: Philippe Martin <phmartin@redhat.com>
Updated dependencies to address high-severity vulnerabilities: - pillow: 11.1.0 -> 12.1.1 (security patches) - cairosvg: 2.7.1 -> 2.9.0 (security patches) These dependencies are used by Material theme for social card generation. Signed-off-by: Philippe Martin <phmartin@redhat.com>
Changed edit_uri from 'edit/main/' to 'blob/main/README.md' so that 'Edit this page' links point to the actual source file (README.md) instead of non-existent generated files like 'introduction.md'. Since all documentation pages are dynamically generated from README.md by hooks.py, all edit links should point to the single source of truth. Signed-off-by: Philippe Martin <phmartin@redhat.com>
Don't include the ## heading in page content since MkDocs Material theme already displays the page title at the top. This prevents the heading from appearing twice on each page. Signed-off-by: Philippe Martin <phmartin@redhat.com>
Implements a static documentation website using MkDocs that automatically
splits README.md into multiple pages based on level 2 headings. The site
is deployed to GitHub Pages via GitHub Actions on every merge to main.
Closes #95