Makefile: let make html depend on generated metrics.rst

This commit is contained in:
Erik Sundell
2020-10-01 10:07:14 +02:00
parent b194135a0f
commit e15b6ad52e
4 changed files with 7 additions and 4 deletions

View File

@@ -64,7 +64,7 @@ jobs:
name: Build docs to store name: Build docs to store
command: | command: |
cd docs cd docs
make metrics html make html
# Tell Circle to store the documentation output in a folder that we can access later # Tell Circle to store the documentation output in a folder that we can access later
- store_artifacts: - store_artifacts:
path: docs/build/html/ path: docs/build/html/

View File

@@ -61,10 +61,12 @@ rest-api: source/_static/rest-api/index.html
source/_static/rest-api/index.html: rest-api.yml node_modules source/_static/rest-api/index.html: rest-api.yml node_modules
npm run rest-api npm run rest-api
metrics: metrics: source/monitoring/_gen/metrics.rst
source/monitoring/_gen/metrics.rst: generate-metrics.py
python3 generate-metrics.py python3 generate-metrics.py
html: rest-api html: rest-api metrics
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo @echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html." @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

View File

@@ -45,6 +45,7 @@ class Generator:
content = f"{title}\n{underline}\n{writer.dumps()}" content = f"{title}\n{underline}\n{writer.dumps()}"
with open(filename, 'w') as f: with open(filename, 'w') as f:
f.write(content) f.write(content)
print(f"Generated {filename}.")
def main(): def main():

View File

@@ -217,7 +217,7 @@ intersphinx_mapping = {'https://docs.python.org/3/': None}
on_rtd = os.environ.get('READTHEDOCS', None) == 'True' on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if on_rtd: if on_rtd:
# readthedocs.org uses their theme by default, so no need to specify it # readthedocs.org uses their theme by default, so no need to specify it
# build rest-api, since RTD doesn't run make # build both metrics and rest-api, since RTD doesn't run make
from subprocess import check_call as sh from subprocess import check_call as sh
sh(['make', 'metrics', 'rest-api'], cwd=docs) sh(['make', 'metrics', 'rest-api'], cwd=docs)