From b7e1eb0184ec8b4e4dd3eebf381c8c44ca3f21cb Mon Sep 17 00:00:00 2001 From: Caroline Malin-Mayor Date: Fri, 23 Feb 2024 15:45:17 -0500 Subject: [PATCH] Add pdoc docs workflow --- .github/workflows/docs.yaml | 40 ++++++++++++++++++++++++++++++++++ .gitignore | 17 +++++---------- src/motile_toolbox/__init__.py | 2 +- 3 files changed, 46 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/docs.yaml diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml new file mode 100644 index 0000000..4be4968 --- /dev/null +++ b/.github/workflows/docs.yaml @@ -0,0 +1,40 @@ +name: Docs build + +# build the documentation whenever there are new commits on main +on: + push: + branches: + - main + +# security: restrict permissions for CI jobs. +permissions: + contents: read + +jobs: + # Build the documentation and upload the static HTML files as an artifact. + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + - run: pip install -e .[dev] + - run: pdoc -o docs/ -d google src/motile_toolbox + - uses: actions/upload-pages-artifact@v3 + with: + path: docs/ + + # Deploy the artifact to GitHub pages. + deploy: + needs: build + runs-on: ubuntu-latest + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - id: deployment + uses: actions/deploy-pages@v4 diff --git a/.gitignore b/.gitignore index bfbb2c8..78ffd87 100644 --- a/.gitignore +++ b/.gitignore @@ -68,8 +68,8 @@ instance/ # Scrapy stuff: .scrapy -# Sphinx documentation -docs/_build/ +# Pdoc documentation +docs/ # PyBuilder target/ @@ -110,16 +110,6 @@ ENV/ env.bak/ venv.bak/ -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - # mypy .mypy_cache/ .dmypy.json @@ -129,3 +119,6 @@ dmypy.json .pyre/ pyrepo .vscode/ + +# OS Files +.DS_Store diff --git a/src/motile_toolbox/__init__.py b/src/motile_toolbox/__init__.py index a0e594e..b196e31 100644 --- a/src/motile_toolbox/__init__.py +++ b/src/motile_toolbox/__init__.py @@ -1,3 +1,3 @@ """ -.. include ../../README.md +.. include:: ../../README.md """