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
3 changes: 1 addition & 2 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ test: Makefile

clean: Makefile
rm -f api.rst
rm -rf api/*
rm -rf api/*.rst
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
python gen_api.py
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
5 changes: 5 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@

import pyaml

# Generate reference API
from pyaml.apidoc.gen_api import gen_doc

gen_doc()

# -- Project information -----------------------------------------------------

project = "Python Accelerator Middle Layer"
Expand Down
27 changes: 14 additions & 13 deletions docs/gen_api.py → pyaml/apidoc/gen_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,17 @@ def generate_toctree(filename: str, title: str, level: int, module: str):


# Generate toctrees
sys.stdout.write("Generating API")
sys.stdout.flush()
paths = generate_toctree("api.rst", "API Reference", 0, "pyaml")
level = 1
while len(paths) > 0:
npaths = []
for p in paths:
npaths.extend(
generate_toctree(f"api/{'pyaml.' + p}.rst", f"{p}", level, "pyaml." + p)
)
paths = npaths
level += 1
print("done")
def gen_doc():
sys.stdout.write("Generating API")
sys.stdout.flush()
paths = generate_toctree("api.rst", "API Reference", 0, "pyaml")
level = 1
while len(paths) > 0:
npaths = []
for p in paths:
npaths.extend(
generate_toctree(f"api/{'pyaml.' + p}.rst", f"{p}", level, "pyaml." + p)
)
paths = npaths
level += 1
print("done")
Loading