mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
moved docs generation and templates to docs/
This commit is contained in:
parent
b4c47ebf68
commit
424e1946f4
8 changed files with 14 additions and 12 deletions
3
Makefile
3
Makefile
|
@ -21,7 +21,7 @@ OS = $(shell uname -s)
|
||||||
# Manpages are currently built with asciidoc -- would like to move to markdown
|
# Manpages are currently built with asciidoc -- would like to move to markdown
|
||||||
# This doesn't evaluate until it's called. The -D argument is the
|
# This doesn't evaluate until it's called. The -D argument is the
|
||||||
# directory of the target file ($@), kinda like `dirname`.
|
# directory of the target file ($@), kinda like `dirname`.
|
||||||
MANPAGES := docs/man/man1/ansible.1 docs/man/man1/ansible-playbook.1 docs/man/man1/ansible-pull.1 docs/man/man1/ansible-doc.1 docs/man/man1/ansible-galaxy.1 docs/man/man1/ansible-vault.1 docs/man/man1/ansible-console.1
|
MANPAGES := docs/man/man1/ansible.1 docs/man/man1/ansible-playbook.1 docs/man/man1/ansible-pull.1 docs/man/man1/ansible-doc.1 docs/man/man1/ansible-galaxy.1
|
||||||
ifneq ($(shell which a2x 2>/dev/null),)
|
ifneq ($(shell which a2x 2>/dev/null),)
|
||||||
ASCII2MAN = a2x -L -D $(dir $@) -d manpage -f manpage $<
|
ASCII2MAN = a2x -L -D $(dir $@) -d manpage -f manpage $<
|
||||||
ASCII2HTMLMAN = a2x -L -D docs/html/man/ -d manpage -f xhtml
|
ASCII2HTMLMAN = a2x -L -D docs/html/man/ -d manpage -f xhtml
|
||||||
|
@ -160,6 +160,7 @@ clean:
|
||||||
find ./docs/man -type f -name "*.xml" -delete
|
find ./docs/man -type f -name "*.xml" -delete
|
||||||
find ./docs/man -type f -name "*.asciidoc" -delete
|
find ./docs/man -type f -name "*.asciidoc" -delete
|
||||||
find ./docs/man/man3 -type f -name "*.3" -delete
|
find ./docs/man/man3 -type f -name "*.3" -delete
|
||||||
|
find ./docs/man/man1 -type f -name "*.1" -delete
|
||||||
@echo "Cleaning up output from test runs"
|
@echo "Cleaning up output from test runs"
|
||||||
rm -rf test/test_data
|
rm -rf test/test_data
|
||||||
@echo "Cleaning up RPM building stuff"
|
@echo "Cleaning up RPM building stuff"
|
||||||
|
|
|
@ -10,7 +10,7 @@ from ansible.playbook.block import Block
|
||||||
from ansible.playbook.role import Role
|
from ansible.playbook.role import Role
|
||||||
from ansible.playbook.task import Task
|
from ansible.playbook.task import Task
|
||||||
|
|
||||||
template_file = 'playbooks_directives.rst.j2'
|
template_file = 'playbooks_keywords.rst.j2'
|
||||||
oblist = {}
|
oblist = {}
|
||||||
clist = []
|
clist = []
|
||||||
class_list = [ Play, Role, Block, Task ]
|
class_list = [ Play, Role, Block, Task ]
|
||||||
|
@ -20,7 +20,7 @@ p = optparse.OptionParser(
|
||||||
usage='usage: %prog [options]',
|
usage='usage: %prog [options]',
|
||||||
description='Generate module documentation from metadata',
|
description='Generate module documentation from metadata',
|
||||||
)
|
)
|
||||||
p.add_option("-T", "--template-dir", action="store", dest="template_dir", default="hacking/templates", help="directory containing Jinja2 templates")
|
p.add_option("-T", "--template-dir", action="store", dest="template_dir", default="../templates", help="directory containing Jinja2 templates")
|
||||||
p.add_option("-o", "--output-dir", action="store", dest="output_dir", default='/tmp/', help="Output directory for rst files")
|
p.add_option("-o", "--output-dir", action="store", dest="output_dir", default='/tmp/', help="Output directory for rst files")
|
||||||
p.add_option("-d", "--docs-source", action="store", dest="docs", default=None, help="Source for attribute docs")
|
p.add_option("-d", "--docs-source", action="store", dest="docs", default=None, help="Source for attribute docs")
|
||||||
|
|
|
@ -213,7 +213,7 @@ def jinja2_environment(template_dir, typ):
|
||||||
env.filters['html_ify'] = html_ify
|
env.filters['html_ify'] = html_ify
|
||||||
env.filters['fmt'] = rst_fmt
|
env.filters['fmt'] = rst_fmt
|
||||||
env.filters['xline'] = rst_xline
|
env.filters['xline'] = rst_xline
|
||||||
template = env.get_template('rst.j2')
|
template = env.get_template('plugin.rst.j2')
|
||||||
outputname = "%s_module.rst"
|
outputname = "%s_module.rst"
|
||||||
else:
|
else:
|
||||||
raise Exception("unknown module format type: %s" % typ)
|
raise Exception("unknown module format type: %s" % typ)
|
|
@ -1,7 +1,7 @@
|
||||||
OS := $(shell uname -s)
|
OS := $(shell uname -s)
|
||||||
SITELIB = $(shell python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"):
|
SITELIB = $(shell python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"):
|
||||||
FORMATTER=../../hacking/module_formatter.py
|
FORMATTER=../bin/plugin_formatter.py
|
||||||
DUMPER=../../hacking/dump_playbook_attributes.py
|
DUMPER=../bin/dump_keywords.py
|
||||||
ifeq ($(shell echo $(OS) | egrep -ic 'Darwin|FreeBSD|OpenBSD|DragonFly'),1)
|
ifeq ($(shell echo $(OS) | egrep -ic 'Darwin|FreeBSD|OpenBSD|DragonFly'),1)
|
||||||
CPUS ?= $(shell sysctl hw.ncpu|awk '{print $$2}')
|
CPUS ?= $(shell sysctl hw.ncpu|awk '{print $$2}')
|
||||||
else
|
else
|
||||||
|
@ -12,7 +12,7 @@ all: docs
|
||||||
|
|
||||||
docs: clean htmldocs
|
docs: clean htmldocs
|
||||||
|
|
||||||
htmldocs: directives modules staticmin
|
htmldocs: keywords modules staticmin
|
||||||
CPUS=$(CPUS) $(MAKE) -f Makefile.sphinx html
|
CPUS=$(CPUS) $(MAKE) -f Makefile.sphinx html
|
||||||
|
|
||||||
webdocs: docs
|
webdocs: docs
|
||||||
|
@ -36,14 +36,15 @@ clean:
|
||||||
-rm rst/*_by_category.rst
|
-rm rst/*_by_category.rst
|
||||||
-rm rst/*_module.rst
|
-rm rst/*_module.rst
|
||||||
-rm rst/playbooks_directives.rst
|
-rm rst/playbooks_directives.rst
|
||||||
|
-rm rst/playbooks_keywords.rst
|
||||||
|
|
||||||
.PHONEY: docs clean
|
.PHONEY: docs clean
|
||||||
|
|
||||||
directives: $(FORMATTER) ../../hacking/templates/rst.j2
|
keywords: $(FORMATTER) ../templates/playbooks_keywords.rst.j2
|
||||||
PYTHONPATH=../../lib $(DUMPER) --template-dir=../../hacking/templates --output-dir=rst/ -d ./directive_desc.yml
|
PYTHONPATH=../../lib $(DUMPER) --template-dir=../templates --output-dir=rst/ -d ./keyword_desc.yml
|
||||||
|
|
||||||
modules: $(FORMATTER) ../../hacking/templates/rst.j2
|
modules: $(FORMATTER) ../templates/plugin.rst.j2
|
||||||
PYTHONPATH=../../lib $(FORMATTER) -t rst --template-dir=../../hacking/templates --module-dir=../../lib/ansible/modules -o rst/
|
PYTHONPATH=../../lib $(FORMATTER) -t rst --template-dir=../templates --module-dir=../../lib/ansible/modules -o rst/
|
||||||
|
|
||||||
staticmin:
|
staticmin:
|
||||||
cat _themes/srtd/static/css/theme.css | sed -e 's/^[ ]*//g; s/[ ]*$$//g; s/\([:{;,]\) /\1/g; s/ {/{/g; s/\/\*.*\*\///g; /^$$/d' | sed -e :a -e '$$!N; s/\n\(.\)/\1/; ta' > _themes/srtd/static/css/theme.min.css
|
cat _themes/srtd/static/css/theme.css | sed -e 's/^[ ]*//g; s/[ ]*$$//g; s/\([:{;,]\) /\1/g; s/ {/{/g; s/\/\*.*\*\///g; /^$$/d' | sed -e :a -e '$$!N; s/\n\(.\)/\1/; ta' > _themes/srtd/static/css/theme.min.css
|
||||||
|
|
|
@ -21,4 +21,4 @@ and adopt these only if they seem relevant or useful to your environment.
|
||||||
playbooks_tags
|
playbooks_tags
|
||||||
playbooks_vault
|
playbooks_vault
|
||||||
playbooks_startnstep
|
playbooks_startnstep
|
||||||
playbooks_directives
|
playbooks_keywords
|
||||||
|
|
Loading…
Add table
Reference in a new issue