[GRASS-SVN] r61717 - in grass/trunk: lib/python/docs man

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Aug 23 04:20:56 PDT 2014


Author: neteler
Date: 2014-08-23 04:20:56 -0700 (Sat, 23 Aug 2014)
New Revision: 61717

Modified:
   grass/trunk/lib/python/docs/Makefile
   grass/trunk/man/build_html.py
Log:
pygrass/python sphinx documentation: fix Makefile, update link in HTML manual

Modified: grass/trunk/lib/python/docs/Makefile
===================================================================
--- grass/trunk/lib/python/docs/Makefile	2014-08-22 14:04:49 UTC (rev 61716)
+++ grass/trunk/lib/python/docs/Makefile	2014-08-23 11:20:56 UTC (rev 61717)
@@ -4,29 +4,7 @@
 include $(MODULE_TOPDIR)/include/Make/Vars.make
 include $(MODULE_TOPDIR)/include/Make/Rules.make
 
-# You can set these variables from the command line.
-SPHINXOPTS    =
-APIDOC := $(shell sphinx-apidoc2 --help 2>/dev/null)
-ifdef APIDOC
-SPHINXAPIDOC = sphinx-apidoc2
-else
-    APIDOC := $(shell sphinx-apidoc --help 2>/dev/null)
-    ifdef APIDOC
-	SPHINXAPIDOC = sphinx-apidoc
-    endif
-endif
 
-BUILD := $(shell sphinx-build2 --version 2>/dev/null)
-ifdef BUILD
-    SPHINXBUILD = sphinx-build2
-else
-    BUILD := $(shell sphinx-build --version 2>/dev/null)
-    ifdef BUILD
-	SPHINXBUILD = sphinx-build
-    endif
-endif
-
-
 PAPER         =
 BUILDDIR      = _build
 BUILDDIR_HTML = $(HTMLDIR)/libpython
@@ -39,11 +17,23 @@
 ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) -c . src/
 # the i18n builder cannot share the environment and doctrees with the others
 I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+SPHINXBUILD     = sphinx-build
+SPHINXAPIDOC    = sphinx-apidoc
 
-.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
+# some distros come with a different name
+BUILD  := $(type $(SPHINXBUILD) >/dev/null)  || (SPHINXBUILD  = sphinx-build2)
+APIDOC := $(type $(SPHINXAPIDOC) >/dev/null) || (SPHINXAPIDOC = sphinx-apidoc2)
 
-.DEFAULT_GOAL := help
+checksphinx:
+	@echo "SPHINXBUILD: Found <$(SPHINXBUILD)>"
+	@echo "SPHINXAPIDOC: Found <$(SPHINXAPIDOC)>"
+	@(type $(SPHINXBUILD) > /dev/null || (echo "ERROR: Install 'sphinx-build' software first (get from http://sphinx-doc.org)" && exit 1))
+	@(type $(SPHINXAPIDOC) > /dev/null || (echo "ERROR: Install 'sphinx-apidoc' software first (get from http://sphinx-doc.org)" && exit 1))
 
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp checksphinx libpythonapidoc libpythonclean libpythondirhtml libpythondoctest libpythonepub libpythonhelp libpythonhtml libpythonlatex libpythonlatexpdf libpythonman libpythonsinglehtml
+
+.DEFAULT_GOAL := libpythonhelp
+
 libpythonhelp:
 	@echo "Please use \`make <target>' where <target> is one of"
 	@echo "  libpythonhtml       to make standalone HTML files"
@@ -68,7 +58,7 @@
 	-rm -f src/temporal.rst
 
 libpythonapidoc:
-	@echo $(SPHINXAPIDOC)
+	@echo "SPHINXBUILD: Using <$(SPHINXBUILD)>"
 	$(call run_grass,$(SPHINXAPIDOC) -T -f -o src/ ../imaging/)
 	$(call run_grass,$(SPHINXAPIDOC) -T -f -o src/ ../exceptions/)
 	$(call run_grass,$(SPHINXAPIDOC) -T -f -o src/ ../gunittest/)
@@ -76,28 +66,33 @@
 	$(call run_grass,$(SPHINXAPIDOC) -T -f -o src/ ../pygrass/)
 	$(call run_grass,$(SPHINXAPIDOC) -T -f -o src/ ../script/)
 	$(call run_grass,$(SPHINXAPIDOC) -T -f -o src/ ../temporal/)
-	
-libpythonhtml:
+
+libpythonhtml: checksphinx
+	@echo "SPHINXBUILD: Using <$(SPHINXBUILD)>"
 	$(call run_grass,$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR_HTML))
 	@echo
 	@echo "Build finished. The HTML pages are in $(BUILDDIR_HTML)"
 
 libpythondirhtml:
+	@echo "SPHINXBUILD: Using <$(SPHINXBUILD)>"
 	$(call run_grass,$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR_HTML))
 	@echo
 	@echo "Build finished. The HTML pages are in $(BUILDDIR_HTML)"
 
 libpythonsinglehtml:
+	@echo "SPHINXBUILD: Using <$(SPHINXBUILD)>"
 	$(call run_grass,$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR_HTML))
 	@echo
 	@echo "Build finished. The HTML page is in $(BUILDDIR_HTML)"
 
 libpythonepub:
+	@echo "SPHINXBUILD: Using <$(SPHINXBUILD)>"
 	$(call run_grass,$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub)
 	@echo
 	@echo "Build finished. The epub file is in $(BUILDDIR)/epub/"
 
 libpythonlatex:
+	@echo "SPHINXBUILD: Using <$(SPHINXBUILD)>"
 	$(call run_grass,$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex)
 	@echo
 	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@@ -105,17 +100,20 @@
 	      "(use \`make latexpdf' here to do that automatically)."
 
 libpythonlatexpdf:
+	@echo "SPHINXBUILD: Using <$(SPHINXBUILD)>"
 	$(call run_grass,$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex)
 	@echo "Running LaTeX files through pdflatex..."
 	$(MAKE) -C $(BUILDDIR)/latex all-pdf
 	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex/"
 
 libpythonman:
+	@echo "SPHINXBUILD: Using <$(SPHINXBUILD)>"
 	$(call run_grass,$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(MANDIR))
 	@echo
 	@echo "Build finished. The manual pages are in $(MANDIR)/"
 
 libpythondoctest:
+	@echo "SPHINXBUILD: Using <$(SPHINXBUILD)>"
 	$(call run_grass,$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest)
 	@echo "Testing of doctests in the sources finished, look at the " \
 	      "results in $(BUILDDIR)/doctest/output.txt."

Modified: grass/trunk/man/build_html.py
===================================================================
--- grass/trunk/man/build_html.py	2014-08-22 14:04:49 UTC (rev 61716)
+++ grass/trunk/man/build_html.py	2014-08-23 11:20:56 UTC (rev 61717)
@@ -171,7 +171,8 @@
       </td>
       <td valign="top" bgcolor="${box_color}" class="box"><h3> Python</h3>
        <ul>
-        <li class="box"><a href="pygrass/index.html">PyGRASS documentation</a></li>
+        <li class="box"><a href="libpython/index.html">PyGRASS documentation</a></li>
+        <li class="box"><a href="libpython/index.html">GRASS GIS Testsuite</a></li>
        </ul>
       </td>
     </tr>



More information about the grass-commit mailing list