From 5578eb9418b33f4ca61c308c271c0076e30653cf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Herv=C3=A9=20M=C3=A9nager?= <herve.menager@pasteur.fr>
Date: Mon, 4 May 2020 16:23:26 +0200
Subject: [PATCH] clean up the docs generation (sphinx-api and graph_models)

---
 .gitlab-ci.yml         | 2 --
 ippisite/docs/Makefile | 6 +++++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 82872695..34b59796 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -62,8 +62,6 @@ test-centos7:
   - coverage html
   - pip3.6 install sphinx sphinx-argparse sphinxcontrib.bibtex sphinx_rtd_theme
   - cd docs
-  - sphinx-apidoc -o source/ippidb/ ../ippidb
-  - sphinx-apidoc -o source/ippisite/ ../ippisite
   - make html
   artifacts:
     paths:
diff --git a/ippisite/docs/Makefile b/ippisite/docs/Makefile
index 69fe55ec..5fa94b06 100644
--- a/ippisite/docs/Makefile
+++ b/ippisite/docs/Makefile
@@ -3,6 +3,8 @@
 
 # You can set these variables from the command line.
 SPHINXOPTS    =
+SPHINXAPI     = sphinx-apidoc
+SPHINXAPISRC  = ..
 SPHINXBUILD   = sphinx-build
 SOURCEDIR     = source
 BUILDDIR      = build
@@ -16,4 +18,6 @@ help:
 # Catch-all target: route all unknown targets to Sphinx using the new
 # "make mode" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).
 %: Makefile
-	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
\ No newline at end of file
+	@$(SPHINXAPI) -o $(SOURCEDIR) $(SPHINXAPISRC)
+	python ../manage.py graph_models ippidb --dot > source/db.dot
+	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
-- 
GitLab