|
|
@ -18,6 +18,7 @@
|
|
|
|
#
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
import os
|
|
|
|
import os
|
|
|
|
|
|
|
|
import glob
|
|
|
|
import sys
|
|
|
|
import sys
|
|
|
|
import yaml
|
|
|
|
import yaml
|
|
|
|
import codecs
|
|
|
|
import codecs
|
|
|
@ -137,6 +138,20 @@ def boilerplate():
|
|
|
|
print >>sys.stderr, "Missing example boiler plate: %S" % EXAMPLE_YAML
|
|
|
|
print >>sys.stderr, "Missing example boiler plate: %S" % EXAMPLE_YAML
|
|
|
|
print file(EXAMPLE_YAML).read()
|
|
|
|
print file(EXAMPLE_YAML).read()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def list_modules(module_dir):
|
|
|
|
|
|
|
|
categories = {}
|
|
|
|
|
|
|
|
files = glob.glob("%s/*" % module_dir)
|
|
|
|
|
|
|
|
for d in files:
|
|
|
|
|
|
|
|
if os.path.isdir(d):
|
|
|
|
|
|
|
|
files2 = glob.glob("%s/*" % d)
|
|
|
|
|
|
|
|
for f in files2:
|
|
|
|
|
|
|
|
tokens = f.split("/")
|
|
|
|
|
|
|
|
module = tokens[-1]
|
|
|
|
|
|
|
|
category = tokens[-2]
|
|
|
|
|
|
|
|
if not category in categories:
|
|
|
|
|
|
|
|
categories[category] = {}
|
|
|
|
|
|
|
|
categories[category][module] = f
|
|
|
|
|
|
|
|
return categories
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
def main():
|
|
|
|
|
|
|
|
|
|
|
@ -274,12 +289,30 @@ def main():
|
|
|
|
|
|
|
|
|
|
|
|
# Temporary variable required to genrate aggregated content in 'js' format.
|
|
|
|
# Temporary variable required to genrate aggregated content in 'js' format.
|
|
|
|
js_data = []
|
|
|
|
js_data = []
|
|
|
|
for module in sorted(os.listdir(options.module_dir)):
|
|
|
|
|
|
|
|
|
|
|
|
categories = list_modules(options.module_dir)
|
|
|
|
|
|
|
|
last_category = None
|
|
|
|
|
|
|
|
category_names = categories.keys()
|
|
|
|
|
|
|
|
category_names.sort()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for category in category_names:
|
|
|
|
|
|
|
|
module_map = categories[category]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
category = category.replace("_"," ")
|
|
|
|
|
|
|
|
category = category.title()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
modules = module_map.keys()
|
|
|
|
|
|
|
|
modules.sort()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for module in modules:
|
|
|
|
|
|
|
|
fname = module_map[module]
|
|
|
|
|
|
|
|
|
|
|
|
if len(options.module_list):
|
|
|
|
if len(options.module_list):
|
|
|
|
if not module in options.module_list:
|
|
|
|
if not module in options.module_list:
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
|
|
|
fname = os.path.join(options.module_dir, module)
|
|
|
|
# fname = os.path.join(options.module_dir, module)
|
|
|
|
|
|
|
|
|
|
|
|
extra = os.path.join("inc", "%s.tex" % module)
|
|
|
|
extra = os.path.join("inc", "%s.tex" % module)
|
|
|
|
|
|
|
|
|
|
|
|
# probably could just throw out everything with extensions
|
|
|
|
# probably could just throw out everything with extensions
|
|
|
@ -317,7 +350,18 @@ def main():
|
|
|
|
doc['ansible_version'] = options.ansible_version
|
|
|
|
doc['ansible_version'] = options.ansible_version
|
|
|
|
doc['plainexamples'] = examples #plain text
|
|
|
|
doc['plainexamples'] = examples #plain text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# BOOKMARK: here is where we build the table of contents...
|
|
|
|
|
|
|
|
|
|
|
|
if options.includes_file is not None and includefmt != "":
|
|
|
|
if options.includes_file is not None and includefmt != "":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if last_category != category:
|
|
|
|
|
|
|
|
incfile.write("\n\n")
|
|
|
|
|
|
|
|
incfile.write(category)
|
|
|
|
|
|
|
|
incfile.write("\n")
|
|
|
|
|
|
|
|
incfile.write('=' * len(category))
|
|
|
|
|
|
|
|
incfile.write("\n\n")
|
|
|
|
|
|
|
|
last_category = category
|
|
|
|
|
|
|
|
|
|
|
|
incfile.write(includefmt % module)
|
|
|
|
incfile.write(includefmt % module)
|
|
|
|
|
|
|
|
|
|
|
|
if options.verbose:
|
|
|
|
if options.verbose:
|
|
|
|