Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Use of this source code is governed by a BSD-3-Clause license that can
# be found in the LICENSE file or at https://opensource.org/licenses/BSD-3-Clause

.PHONY: _maybe_patch_pyproject all api-list build check clean distclean distclean-all docs docs-clean docs-open env env-all env-docs env-highest-torch env-tutorial set-auto-venv test test-cov test-fast test-highest-pytorch test-lowest-pytorch test-slow test-smoke test-tutorials version
.PHONY: _maybe_patch_pyproject all api-list build check clean distclean distclean-all docs docs-clean docs-open env env-all env-docs env-highest-torch env-tutorial render-api-index set-auto-venv test test-cov test-fast test-highest-pytorch test-lowest-pytorch test-slow test-smoke test-tutorials version

SHELL := /bin/bash

Expand Down Expand Up @@ -331,6 +331,13 @@ endif
docs-clean:
@rm -rf $(DOCS_DIR)/build $(DOCS_DIR)/src/api/generated

# Regenerate docs/src/api/index.md from the package tree.
#
# Runs the same generator `make docs` invokes during the Sphinx build, so the
# API index can be refreshed on its own using the base dev env.
render-api-index:
@$(call use_env,VENV) && uv run --no-sync --active python $(MAKEFILE_DIR)docs/scripts/generate_api_index.py

# Build and open documentation in browser
# Uses --serve so the docs are loaded over HTTP, not file:// — required for
# the Copy page button (and any other feature using fetch()/clipboard APIs).
Expand Down
3 changes: 2 additions & 1 deletion docs/scripts/generate_api_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ def generate_api_index() -> str:


if __name__ == "__main__":
repo_root = find_repo_root(__file__)
# Anchor on the cwd so `make` writes the invoking repo's index.
repo_root = find_repo_root()
output = repo_root / _OUTPUT_PATH

content = generate_api_index()
Expand Down