summaryrefslogtreecommitdiff
path: root/doc/Makefile
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-05-24 20:26:24 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-05-24 20:28:37 +0900
commit25325b0d6f8dc93e2bd40d3f81637c36bf0b3158 (patch)
treed564768ef1a563b10cbc1f4a8a1ca5c39d5b2e0a /doc/Makefile
parent01fd7dfc0497121ef544fc4c86a7b547260d933e (diff)
downloadbuildstream-25325b0d6f8dc93e2bd40d3f81637c36bf0b3158.tar.gz
Added __init__.py to the plugin subdirectories.
This makes the 'sources' and 'elements' subdirectores modules technically, but it does not effect how we load them with pluginbase, that still works. Updated documentation machinery to have buildstream/plugins in the PYTHONPATH and import the docs as elements.autotools etc. This is all because since recent sphinx started importing from distutils, this was conflicting with our distutils plugin.
Diffstat (limited to 'doc/Makefile')
-rw-r--r--doc/Makefile24
1 files changed, 13 insertions, 11 deletions
diff --git a/doc/Makefile b/doc/Makefile
index 70e0ced95..7d3b3d789 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -48,14 +48,16 @@ all: docs
# from plugin documentation.
#
define plugin-doc-skeleton
- @for file in $$(find ${1} -name "*.py"); do \
- base=$$(basename $$file); \
- modname=$${base%.py}; \
- echo -n "Generating ${2}/$${modname}.rst... "; \
- sed -e "s|@@MODULE@@|$${modname}|g" \
- source/plugin.rsttemplate > \
- ${2}/$${modname}.rst.tmp && \
- mv ${2}/$${modname}.rst.tmp ${2}/$${modname}.rst || exit 1; \
+ @for file in $$(find ${1} -name "*.py"); do \
+ base=$$(basename $$file); \
+ module=${2}.$${base%.py}; \
+ modname=$${base%.py}; \
+ echo -n "Generating source/${2}/$${modname}.rst... "; \
+ sed -e "s|@@MODULENAME@@|$${modname}|g" \
+ -e "s|@@MODULE@@|$${module}|g" \
+ source/plugin.rsttemplate > \
+ source/${2}/$${modname}.rst.tmp && \
+ mv source/${2}/$${modname}.rst.tmp source/${2}/$${modname}.rst || exit 1; \
echo "Done."; \
done
endef
@@ -66,13 +68,13 @@ apidoc:
mkdir -p source/elements
mkdir -p source/sources
sphinx-apidoc --separate -o source $(CURDIR)/../buildstream
- $(call plugin-doc-skeleton,$(CURDIR)/../buildstream/plugins/elements,source/elements)
- $(call plugin-doc-skeleton,$(CURDIR)/../buildstream/plugins/sources,source/sources)
+ $(call plugin-doc-skeleton,$(CURDIR)/../buildstream/plugins/elements,elements)
+ $(call plugin-doc-skeleton,$(CURDIR)/../buildstream/plugins/sources,sources)
# We set PYTHONPATH here because source/conf.py sys.modules hacks dont seem to help sphinx-build import the plugins
.PHONY: docs
docs: apidoc
- PYTHONPATH=$(CURDIR)/../buildstream/plugins/sources:$(CURDIR)/../buildstream/plugins/elements \
+ PYTHONPATH=$(CURDIR)/../buildstream/plugins \
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html \
$(wildcard source/*.rst) \
$(wildcard source/elements/*.rst) \