Skip to content

Commit a48d529

Browse files
committed
Add docs targets to Makefile and make.bat
Added `docs` command to build API documentation with pdoc and symlink it to `docs/html`. Also fixed the existing `build_docs` target in the Makefile to use `uv run`.
1 parent e1b5f1b commit a48d529

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

‎Makefile‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: install_base install_deps build_docs build test run help all build_wasm build_docker run_docker
1+
.PHONY: install_base install_deps docs build_docs build test run help all build_wasm build_docker run_docker
22

33
.DEFAULT_GOAL := help
44

@@ -36,10 +36,16 @@ install_deps:
3636
uv venv || python3 -m venv .venv
3737
uv pip install -e ".[dev]" || pip install -e ".[dev]"
3838

39+
docs:
40+
@rm -rf docs/api docs/html
41+
@mkdir -p docs/api
42+
uv run pdoc src/openapi_client -o docs/api
43+
@cd docs && ln -sf api html
44+
3945
build_docs:
4046
@echo "Building docs in $(DOCS_DIR)"
4147
@mkdir -p $(DOCS_DIR)
42-
pdoc src/openapi_client -o $(DOCS_DIR)
48+
uv run pdoc src/openapi_client -o $(DOCS_DIR)
4349

4450
build:
4551
@echo "Building binary/package in $(BIN_DIR)"
@@ -58,6 +64,7 @@ help:
5864
@echo "Available tasks:"
5965
@echo " install_base : install language runtime (Python 3)"
6066
@echo " install_deps : install local dependencies"
67+
@echo " docs : build the API docs and symlink to docs/html"
6168
@echo " build_docs : build the API docs [dir]"
6269
@echo " build : build the CLI [dir]"
6370
@echo " test : run tests locally"

‎make.bat‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if "%TASK%"=="" set TASK=help
66

77
if "%TASK%"=="install_base" goto install_base
88
if "%TASK%"=="install_deps" goto install_deps
9+
if "%TASK%"=="docs" goto docs
910
if "%TASK%"=="build_docs" goto build_docs
1011
if "%TASK%"=="build" goto build
1112
if "%TASK%"=="test" goto test
@@ -20,6 +21,7 @@ if "%TASK%"=="all" goto help
2021
echo Available tasks:
2122
echo install_base : install language runtime (Python 3 via winget)
2223
echo install_deps : install local dependencies
24+
echo docs : build the API docs and symlink to docs/html
2325
echo build_docs : build the API docs [dir]
2426
echo build : build the CLI [dir]
2527
echo test : run tests locally
@@ -42,6 +44,16 @@ uv venv
4244
uv pip install -e ".[dev]"
4345
goto :EOF
4446

47+
:docs
48+
if exist docs\api rmdir /s /q docs\api
49+
if exist docs\html rmdir /s /q docs\html
50+
mkdir docs\api 2>NUL
51+
.venv\Scripts\python.exe -m pdoc src/openapi_client -o docs\api
52+
cd docs
53+
mklink /J html api
54+
cd ..
55+
goto :EOF
56+
4557
:build_docs
4658
set DOCS_DIR=%2
4759
if "%DOCS_DIR%"=="" set DOCS_DIR=docs

0 commit comments

Comments
 (0)