summaryrefslogtreecommitdiff
path: root/docs/docsite/Makefile
diff options
context:
space:
mode:
authorToshio Kuratomi <a.badger@gmail.com>2019-07-16 12:19:01 -0700
committerGitHub <noreply@github.com>2019-07-16 12:19:01 -0700
commit019d078a5a457823e8d445d4e949b5ed041e2609 (patch)
treea93e0b58128c324652cacea3231dadcaae1a5492 /docs/docsite/Makefile
parent65e0f37fc05500dcd8f68b2e4a3294fb1db6849a (diff)
downloadansible-019d078a5a457823e8d445d4e949b5ed041e2609.tar.gz
Move common build code from _build_helpers (#55986)
We have some common code used by several docs scripts. Migrate that into the build-only shared code repository. * Move lib/ansible/utils/_build_helpers.py to the directory for common build code * Migrate docs/bin/dump_config.py to a build-ansible subcommand * Migrate dump_keywords to the build-ansible framework * Make the script more maintainable by using functions and good variable names * Port to Python3 idioms * Fix bug so that private attributes will be undocumented * Move generate_man to a build-ansible subcommand * Port plugin_formatter to a build-ansible subcommand * Rework command_plugins so that docs scripts can target Python-3.4+ and releng-only subcommands can use more recent versions of Python. The architecture is now that command_plugins/* need to be importable on Python-3.4. The init_parsers() method needs to run on Python-3.4. But the main() method can utilize features of more recent Python as long as it fits within those parameters. * Update docs build requirements Port the plugin_formatter to build-ansible framework
Diffstat (limited to 'docs/docsite/Makefile')
-rw-r--r--docs/docsite/Makefile24
1 files changed, 12 insertions, 12 deletions
diff --git a/docs/docsite/Makefile b/docs/docsite/Makefile
index abfb960223..386998be14 100644
--- a/docs/docsite/Makefile
+++ b/docs/docsite/Makefile
@@ -1,10 +1,10 @@
OS := $(shell uname -s)
SITELIB = $(shell python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"):
-FORMATTER=../bin/plugin_formatter.py
+PLUGIN_FORMATTER=../../hacking/build-ansible.py document-plugins
TESTING_FORMATTER=../bin/testing_formatter.sh
-DUMPER=../bin/dump_keywords.py
-CONFIG_DUMPER=../bin/dump_config.py
-GENERATE_CLI=../bin/generate_man.py
+KEYWORD_DUMPER=../../hacking/build-ansible.py document-keywords
+CONFIG_DUMPER=../../hacking/build-ansible.py document-config
+GENERATE_CLI=../../hacking/build-ansible.py generate-man
ifeq ($(shell echo $(OS) | egrep -ic 'Darwin|FreeBSD|OpenBSD|DragonFly'),1)
CPUS ?= $(shell sysctl hw.ncpu|awk '{print $$2}')
else
@@ -79,24 +79,24 @@ clean:
.PHONY: docs clean
# TODO: make generate_man output dir cli option
-cli: $(GENERATE_CLI)
+cli:
mkdir -p rst/cli
PYTHONPATH=../../lib $(GENERATE_CLI) --template-file=../templates/cli_rst.j2 --output-dir=rst/cli/ --output-format rst ../../lib/ansible/cli/*.py
-keywords: $(FORMATTER) ../templates/playbooks_keywords.rst.j2
- PYTHONPATH=../../lib $(DUMPER) --template-dir=../templates --output-dir=rst/reference_appendices/ -d ./keyword_desc.yml
+keywords: ../templates/playbooks_keywords.rst.j2
+ PYTHONPATH=../../lib $(KEYWORD_DUMPER) --template-dir=../templates --output-dir=rst/reference_appendices/ -d ./keyword_desc.yml
-config:
+config: ../templates/config.rst.j2
PYTHONPATH=../../lib $(CONFIG_DUMPER) --template-file=../templates/config.rst.j2 --output-dir=rst/reference_appendices/ -d ../../lib/ansible/config/base.yml
-modules: $(FORMATTER) ../templates/plugin.rst.j2
- PYTHONPATH=../../lib $(FORMATTER) -t rst --template-dir=../templates --module-dir=../../lib/ansible/modules -o rst/modules/ $(MODULE_ARGS)
+modules: ../templates/plugin.rst.j2
+ PYTHONPATH=../../lib $(PLUGIN_FORMATTER) -t rst --template-dir=../templates --module-dir=../../lib/ansible/modules -o rst/modules/ $(MODULE_ARGS)
-plugins: $(FORMATTER) ../templates/plugin.rst.j2
+plugins: ../templates/plugin.rst.j2
@echo "looping over doc plugins"
for plugin in $(DOC_PLUGINS); \
do \
- PYTHONPATH=../../lib $(FORMATTER) -t rst --plugin-type $$plugin --template-dir=../templates --module-dir=../../lib/ansible/plugins/$$plugin -o rst $(PLUGIN_ARGS); \
+ PYTHONPATH=../../lib $(PLUGIN_FORMATTER) -t rst --plugin-type $$plugin --template-dir=../templates --module-dir=../../lib/ansible/plugins/$$plugin -o rst $(PLUGIN_ARGS); \
done
testing: