Skip to content

Commit

Permalink
Separate docs into different modules. Add make.py script to build the…
Browse files Browse the repository at this point in the history
… docs
  • Loading branch information
bdvllrs committed Mar 6, 2024
1 parent c739207 commit a03839c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
poetry run python -m pip install --upgrade pip
poetry run pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
poetry run pip install lightning
- run: poetry run pdoc ./shimmer/* -o docs/api/ --docformat=google
- run: poetry run python ./docs/make.py
- uses: actions/upload-pages-artifact@v3
with:
path: docs/api/
Expand Down
20 changes: 20 additions & 0 deletions docs/make.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from pathlib import Path

import pdoc

modules = [
"shimmer.types",
"shimmer.modules.global_workspace",
"shimmer.modules.domain",
"shimmer.modules.gw_module",
"shimmer.modules.losses",
"shimmer.modules.contrastive_loss",
"shimmer.dataset",
"shimmer.modules.vae",
]

here = Path(__file__).parent

if __name__ == "__main__":
pdoc.render.configure(docformat="google")
pdoc.pdoc(*modules, output_directory=here / "api")
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ target-version = "py311"
extend-exclude = [
"__pycache__",
".mypy_cache",
"docs",
"docs/api",
".github",
]

Expand Down

0 comments on commit a03839c

Please sign in to comment.