on master help sign in
Makefile: add documentation build targets docs & docs-live

BTW: - add build & dist folder to .gitignore - justify indentation of build messages (makefile.python) Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>

commitef85943e06a1ac0083d8a7c76a08e885f2e27d90 authorMarkus Heiser <markus.heiser@darmarit.de> dateThu 12 Dec 2019, 12:10 (7 years ago) parentbb2b9b8
3 files changed+20−2
.gitignore+2 Makefile+16 utils/makefile.python+2−2
.gitignore+2
@@ -19,5 +19,7 @@ node_modules/
1919
2020.tx/
2121
22+build/
23+dist/
2224local/
2325searx.egg-info/
Makefile+16
@@ -1,16 +1,20 @@
11# -*- coding: utf-8; mode: makefile-gmake -*-
22
33PYOBJECTS = searx
4+DOC = docs
45PY_SETUP_EXTRAS ?= \[test\]
56
67include utils/makefile.include
78include utils/makefile.python
9+include utils/makefile.sphinx
810
911all: clean install
1012
1113PHONY += help
1214help:
1315 @echo ' test - run developer tests'
16+ @echo ' docs - build documentation'
17+ @echo ' docs-live - autobuild HTML documentation while editing'
1418 @echo ' run - run developer instance'
1519 @echo ' install - developer install (./local)'
1620 @echo ' uninstall - uninstall (./local)'
@@ -40,6 +44,18 @@ run: pyenvinstall
4044 ) &
4145 $(PY_ENV)/bin/python ./searx/webapp.py
4246
47+# docs
48+# ----
49+
50+PHONY += docs
51+docs: pyenvinstall sphinx-doc
52+ $(call cmd,sphinx,html,docs,docs)
53+
54+PHONY += docs-live
55+docs-live: pyenvinstall sphinx-live
56+ $(call cmd,sphinx_autobuild,html,docs,docs)
57+
58+
4359# test
4460# ----
4561
utils/makefile.python+2−2
@@ -155,7 +155,7 @@ quiet_cmd_virtualenv = PYENV usage: $ source ./$@/bin/activate
155155 if [ ! -d "./$(PY_ENV)" ];then \
156156 $(VIRTUALENV) $(VIRTUALENV_VERBOSE) $(VTENV_OPTS) $2; \
157157 else \
158− echo " PYENV using virtualenv from $2"; \
158+ echo "PYENV using virtualenv from $2"; \
159159 fi
160160
161161# $2 path to lint
@@ -263,7 +263,7 @@ pydebug: $(PY_ENV)
263263# install / uninstall python objects into virtualenv (PYENV)
264264pyenv-install: $(PY_ENV)
265265 @$(PY_ENV_BIN)/pip $(PIP_VERBOSE) install -e .
266− @echo " ACTIVATE $(call normpath,$(PY_ENV_ACT)) "
266+ @echo "ACTIVATE $(call normpath,$(PY_ENV_ACT)) "
267267
268268pyenv-uninstall: $(PY_ENV)
269269 @$(PY_ENV_BIN)/pip $(PIP_VERBOSE) uninstall --yes .