diff --git a/sphinx.mk b/sphinx.mk index b52d409..4d50b54 100644 --- a/sphinx.mk +++ b/sphinx.mk @@ -3,10 +3,10 @@ SHELL = /usr/bin/bash .SILENT: -SPHINXOPTS = SPHINXBUILD = venv/bin/sphinx-build +SPHINXAPIDOC = venv/bin/sphinx-apidoc SPHINXPRJ = $(shell basename `dirname \`pwd\``) -SOURCEDIR = . +SOURCEDIR = pylibs BUILDDIR = _build localhelp: @@ -28,29 +28,28 @@ conf.py: pydocs/templates/conf.py.tpl pydocs/replace.sh conf.py "" "$$(date +%Y)" pydocs/replace.sh conf.py "" "Dirk Alders" -index.rst: - venv/bin/sphinx-apidoc -TMo . $(SPHINXPRJ) - mv $(SPHINXPRJ).rst index.rst +$(SOURCEDIR)/$(SPHINXPRJ).rst: + $(SPHINXAPIDOC) -TMo $(SOURCEDIR) $(SOURCEDIR)/$(SPHINXPRJ) -html: head examples conf.py index.rst +html: head examples conf.py $(SOURCEDIR)/$(SPHINXPRJ).rst echo -e "\e[1m * Generated html files...\e[0m" - $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + $(SPHINXBUILD) --conf-dir . "$(SOURCEDIR)" "$(BUILDDIR)" examples: - make -C $(SPHINXPRJ)/_examples_ all + make -C pylibs/$(SPHINXPRJ)/_examples_ all localclean: echo -e "\033[1;33mCleanung up docs...\033[00m" echo -e "\e[1m * Sphix config files...\e[0m" - rm -vf conf.py *.rst + rm -vf conf.py pylibs/*.rst echo -e "\e[1m * Sphix build directory...\e[0m" rm -rf $(BUILDDIR) - make --no-print-directory -kC $(SPHINXPRJ)/_examples_ clean + make --no-print-directory -kC pylibs/$(SPHINXPRJ)/_examples_ clean release: html rm -rf $(SPHINXPRJ)/_docs_ mv $(BUILDDIR)/html $(SPHINXPRJ)/_docs_ view: html - xdg-open $(BUILDDIR)/html/index.html + xdg-open $(BUILDDIR)/$(SPHINXPRJ).html diff --git a/templates/conf.py.tpl b/templates/conf.py.tpl index 72f1470..2c4881b 100644 --- a/templates/conf.py.tpl +++ b/templates/conf.py.tpl @@ -14,7 +14,7 @@ # import os import sys -sys.path.insert(0, os.path.abspath('.')) +sys.path.insert(0, os.path.abspath('pylibs')) # -- Project information ----------------------------------------------------- @@ -54,7 +54,7 @@ templates_path = ['_templates'] source_suffix = '.rst' # The master toctree document. -master_doc = 'index' +master_doc = '' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages.