Skip to content

Commit

Permalink
Add documentation action
Browse files Browse the repository at this point in the history
  • Loading branch information
mkstratos committed May 2, 2024
1 parent 0a9a0eb commit 426d3fb
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Docs
on:
- push

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: Install requirements for documentation generation
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install docutils pydoctor
- name: Generate API documentation with pydoctor
run: |
# Run pydoctor build
pydoctor \
--project-url=https://github.com/$GITHUB_REPOSITORY \
--html-viewsource-base=https://github.com/$GITHUB_REPOSITORY/tree/$GITHUB_SHA \
--config pyproject.toml
- name: Push API documentation to Github Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
commit_message: "Generate API documentation"
10 changes: 10 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,13 @@ dynamic = ["version"]

[project.optional-dependencies]
dev = ["ruff", "isort", "black"]

[tool.pydoctor]
project-name = "ModelMimic"
make-html = true
html-output = "./docs"
docformat = "numpy"
intersphinx = "https://docs.python.org/3/objects.inv"
theme = "readthedocs"
privacy = ["PRIVATE:**.__*__", "PUBLIC:**.__init__"]
add-package = ["./modelmimic"]

0 comments on commit 426d3fb

Please sign in to comment.