Skip to content

Commit 21c83c0

Browse files
authored
feat: add pdoc for leveraging python docstrings for documentation (#501)
* feat: add pdoc for leveraging python docstrings for documentation * chore: add imports for public APIs
1 parent 20e3c3d commit 21c83c0

File tree

4 files changed

+216
-4
lines changed

4 files changed

+216
-4
lines changed

.github/workflows/pages.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
name: Deploy static content to Pages
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
actions: read
16+
17+
concurrency:
18+
group: "pages"
19+
cancel-in-progress: true
20+
21+
jobs:
22+
deploy:
23+
environment:
24+
name: github-pages
25+
url: ${{ steps.deployment.outputs.page_url }}
26+
runs-on: ubuntu-latest
27+
strategy:
28+
fail-fast: false
29+
steps:
30+
- uses: actions/checkout@v5
31+
- uses: snok/install-poetry@v1.4.1
32+
- name: Install Dependencies
33+
run: poetry install
34+
shell: bash
35+
- run: pdoc ./roborock -o docs/pdoc
36+
- name: Setup Pages
37+
uses: actions/configure-pages@v5
38+
- name: Upload artifact
39+
uses: actions/upload-pages-artifact@v3
40+
with:
41+
# Upload pdoc output
42+
path: 'docs/pdoc/'
43+
- name: Deploy to GitHub Pages
44+
id: deployment
45+
uses: actions/deploy-pages@v4

poetry.lock

Lines changed: 137 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ aioresponses = "^0.7.7"
5151
freezegun = "^1.5.1"
5252
pytest-timeout = "^2.3.1"
5353
syrupy = "^4.9.1"
54+
pdoc = "^15.0.4"
5455

5556
[tool.semantic_release]
5657
branch = "main"

roborock/__init__.py

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,39 @@
1-
"""Roborock API."""
1+
"""Roborock API.
2+
3+
.. include:: ../README.md
4+
"""
25

36
from roborock.b01_containers import *
47
from roborock.code_mappings import *
58
from roborock.containers import *
69
from roborock.exceptions import *
710
from roborock.roborock_typing import *
11+
12+
from . import (
13+
b01_containers,
14+
clean_modes,
15+
cloud_api,
16+
code_mappings,
17+
const,
18+
containers,
19+
exceptions,
20+
roborock_typing,
21+
version_1_apis,
22+
version_a01_apis,
23+
web_api,
24+
)
25+
26+
__all__ = [
27+
"web_api",
28+
"version_1_apis",
29+
"version_a01_apis",
30+
"containers",
31+
"b01_containers",
32+
"const",
33+
"cloud_api",
34+
"clean_modes",
35+
"code_mappings",
36+
"roborock_typing",
37+
"exceptions",
38+
# Add new APIs here in the future when they are public e.g. devices/
39+
]

0 commit comments

Comments
 (0)