Skip to content

Comments

docs: migrate documentation from Sphinx/Read the Docs to VitePress with GitHub Pages deployment#146

Open
nixel2007 wants to merge 1 commit intoerwindouna:mainfrom
nixel2007:feature/migrate-from-read-the-docs
Open

docs: migrate documentation from Sphinx/Read the Docs to VitePress with GitHub Pages deployment#146
nixel2007 wants to merge 1 commit intoerwindouna:mainfrom
nixel2007:feature/migrate-from-read-the-docs

Conversation

@nixel2007
Copy link

Summary

Migrate the documentation system from Sphinx/Read the Docs to VitePress with GitHub Pages deployment.

Changes

  • Replace Sphinx/Read the Docs with VitePress for documentation
  • Add GitHub Pages deployment workflow (triggered on main branch)
  • Auto-generate API docs from Python source code using pydoc-markdown
  • Add documentation deployment badge to README.md
  • Configure VitePress with search, base path, and proper styling

…th GitHub Pages deployment

- Replace Sphinx/Read the Docs with VitePress for documentation
- Add GitHub Pages deployment workflow (triggered on main branch)
- Auto-generate API docs from Python source code using pydoc-markdown
- Add documentation deployment badge to README.md
- Configure VitePress with search, base path, and proper styling

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 19, 2026 07:38
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Migrates the project documentation from Sphinx/Read the Docs to a VitePress-based site published via GitHub Pages, with API reference pages generated from the Python source using pydoc-markdown.

Changes:

  • Add a docs generation script (pydoc-markdown → Markdown) and wire it into VitePress build/dev commands.
  • Introduce a GitHub Pages deployment workflow for the VitePress site and update README badge/links.
  • Remove the previous Sphinx/Read the Docs configuration and source files.

Reviewed changes

Copilot reviewed 20 out of 22 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
scripts/generate_docs.py New script to generate docs/api.md, docs/models.md, docs/exceptions.md via pydoc-markdown.
pyproject.toml Ruff per-file ignore tweak for scripts/*.
package.json Add docs scripts (generate/dev/build/preview) and VitePress dependency.
package-lock.json Lockfile updates for VitePress and its transitive dependencies.
docs/usage.md New Markdown usage page for VitePress docs.
docs/index.md New VitePress home page frontmatter/content.
docs/.vitepress/config.mts VitePress site configuration (nav/sidebar/search/base).
README.md Switch documentation badge/link from Read the Docs to GitHub Pages.
.github/workflows/deploy-docs.yaml New workflow to build and deploy docs to GitHub Pages.
.prettierignore Ignore VitePress build artifacts and generated API docs.
.gitignore Ignore VitePress build artifacts and generated API docs.
.readthedocs.yaml Remove Read the Docs build configuration.
docs/requirements.txt Remove Sphinx requirements.
docs/Makefile Remove Sphinx Makefile.
docs/make.bat Remove Sphinx Windows build script.
docs/__init__.py Remove docs package marker (Sphinx-era).
docs/source/conf.py Remove Sphinx configuration.
docs/source/index.rst Remove Sphinx index page.
docs/source/usage.rst Remove Sphinx usage page.
docs/source/api.rst Remove Sphinx API module page.
docs/source/models.rst Remove Sphinx models reference page.
docs/source/__init__.py Remove docs source package marker (Sphinx-era).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


async def main() -> None:
"""Example usage of Tado Async to retrieve all devices."""
async with Tado("username", "password") as tado:
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

The usage example calls Tado("username", "password"), but Tado.__init__ does not accept username/password (it takes an optional refresh_token, etc.). This example won’t run and will mislead users; update it to match the actual public API (e.g., device-flow usage with await tado.async_init() / async with Tado() and/or passing refresh_token=...).

Suggested change
async with Tado("username", "password") as tado:
async with Tado(refresh_token="your_refresh_token") as tado:
await tado.async_init()

Copilot uses AI. Check for mistakes.
asyncio.run(main())
```

Keep in mind that if you use `async with`, the `__aenter__` and `__aexit__` methods are called automatically. It's recommended you use session control; if you don't use `async with`, you need to call `tado.close()` to close the session.
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

This paragraph mentions calling tado.close() when not using async with, but it doesn’t mention that callers also need to run the async initialization (await tado.async_init()) before making API calls. Add that guidance so the non-context-manager usage path is complete.

Suggested change
Keep in mind that if you use `async with`, the `__aenter__` and `__aexit__` methods are called automatically. It's recommended you use session control; if you don't use `async with`, you need to call `tado.close()` to close the session.
Keep in mind that if you use `async with`, the `__aenter__` and `__aexit__` methods are called automatically. It's recommended you use session control; if you don't use `async with`, you need to run `await tado.async_init()` before making any API calls and call `tado.close()` to close the session when you're done.

Copilot uses AI. Check for mistakes.
Comment on lines +55 to +62
result = subprocess.run(
[ # noqa: S603
pydoc_md,
"-I",
"src",
"-m",
config["module"],
],
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

subprocess.run passes -I src as a relative path, so the script will fail if invoked from a working directory other than the repo root. Consider deriving an absolute src path from __file__ (or setting cwd to the repo root) so doc generation works regardless of where it’s executed from.

Copilot uses AI. Check for mistakes.
Comment on lines +75 to +81
output.write_text(content)
print(f"Generated {output}") # noqa: T201


def main() -> None:
"""Generate all documentation pages."""
pydoc_md = _find_pydoc_markdown()
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

Path.write_text() is called without an explicit encoding. For consistent output across environments/CI, specify encoding="utf-8" (and optionally ensure the docs output directory exists before writing).

Suggested change
output.write_text(content)
print(f"Generated {output}") # noqa: T201
def main() -> None:
"""Generate all documentation pages."""
pydoc_md = _find_pydoc_markdown()
output.write_text(content, encoding="utf-8")
print(f"Generated {output}") # noqa: T201
def main() -> None:
"""Generate all documentation pages."""
pydoc_md = _find_pydoc_markdown()
DOCS_DIR.mkdir(parents=True, exist_ok=True)

Copilot uses AI. Check for mistakes.
"docs:generate": "python3 scripts/generate_docs.py",
"docs:dev": "npm run docs:generate && vitepress dev docs",
"docs:build": "npm run docs:generate && vitepress build docs",
"docs:preview": "vitepress preview docs"
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

The docs:preview script runs vitepress preview docs without ensuring the site has been built first. Since vitepress preview serves the build output, this should typically depend on docs:build (and/or docs:generate) to avoid preview failing on a clean checkout.

Suggested change
"docs:preview": "vitepress preview docs"
"docs:preview": "npm run docs:build && vitepress preview docs"

Copilot uses AI. Check for mistakes.
Copy link
Owner

Choose a reason for hiding this comment

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

Is Copilot right here?

with:
python-version: "3.12"
- name: 🏗 Install pydoc-markdown
run: pip install pydoc-markdown
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

This workflow installs pydoc-markdown via pip install directly, which bypasses the repo’s existing uv-based, locked dependency approach used in other workflows. To make docs builds reproducible, consider adding pydoc-markdown to the project’s dev dependencies and using uv sync/uv run here as well (or at least pin the installed version).

Suggested change
run: pip install pydoc-markdown
run: pip install pydoc-markdown==4.8.2

Copilot uses AI. Check for mistakes.
Copy link
Owner

Choose a reason for hiding this comment

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

We don't use PIP, bu UV instead. :)

@wmalgadey wmalgadey added documentation Solely about the documentation of the project enhancement Enhancement of the code, not introducing new features labels Feb 19, 2026
@erwindouna
Copy link
Owner

There are some merge conflicts now, can you please have a look? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Solely about the documentation of the project enhancement Enhancement of the code, not introducing new features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants