parent
44121352fe
commit
47738eb1dd
5 changed files with 131 additions and 151 deletions
108
docs/api/conf.py
108
docs/api/conf.py
|
@ -18,7 +18,7 @@ import os
|
|||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
#sys.path.insert(0, os.path.abspath('../bin'))
|
||||
# sys.path.insert(0, os.path.abspath('../bin'))
|
||||
sys.path.insert(0, os.path.abspath('../lib/ansible'))
|
||||
import sphinx_rtd_theme
|
||||
import alabaster
|
||||
|
@ -26,7 +26,7 @@ import alabaster
|
|||
# -- General configuration ------------------------------------------------
|
||||
|
||||
# If your documentation needs a minimal Sphinx version, state it here.
|
||||
#needs_sphinx = '1.0'
|
||||
# needs_sphinx = '1.0'
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
|
@ -41,8 +41,8 @@ extensions = [
|
|||
'alabaster',
|
||||
]
|
||||
|
||||
#autodoc_default_flags = ['members', 'show-inheritance', 'inherited-members', 'undoc-members',]
|
||||
autodoc_default_flags = ['members', 'show-inheritance', 'undoc-members',]
|
||||
# autodoc_default_flags = ['members', 'show-inheritance', 'inherited-members', 'undoc-members', ]
|
||||
autodoc_default_flags = ['members', 'show-inheritance', 'undoc-members', ]
|
||||
autoclass_content = 'both'
|
||||
autodoc_member_order = 'bysource'
|
||||
autodoc_mock_imports = ['xmltodict', 'winrm', 'redis', 'StricRedis']
|
||||
|
@ -56,7 +56,7 @@ templates_path = ['_templates']
|
|||
source_suffix = '.rst'
|
||||
|
||||
# The encoding of source files.
|
||||
#source_encoding = 'utf-8-sig'
|
||||
# source_encoding = 'utf-8-sig'
|
||||
|
||||
# The master toctree document.
|
||||
master_doc = 'index'
|
||||
|
@ -84,9 +84,9 @@ language = None
|
|||
|
||||
# There are two options for replacing |today|: either, you set today to some
|
||||
# non-false value, then it is used:
|
||||
#today = ''
|
||||
# today = ''
|
||||
# Else, today_fmt is used as the format for a strftime call.
|
||||
#today_fmt = '%B %d, %Y'
|
||||
# today_fmt = '%B %d, %Y'
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
|
@ -94,27 +94,27 @@ exclude_patterns = ['_build']
|
|||
|
||||
# The reST default role (used for this markup: `text`) to use for all
|
||||
# documents.
|
||||
#default_role = None
|
||||
# default_role = None
|
||||
|
||||
# If true, '()' will be appended to :func: etc. cross-reference text.
|
||||
add_function_parentheses = True
|
||||
|
||||
# If true, the current module name will be prepended to all description
|
||||
# unit titles (such as .. function::).
|
||||
#add_module_names = True
|
||||
# add_module_names = True
|
||||
|
||||
# If true, sectionauthor and moduleauthor directives will be shown in the
|
||||
# output. They are ignored by default.
|
||||
#show_authors = False
|
||||
# show_authors = False
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = 'sphinx'
|
||||
|
||||
# A list of ignored prefixes for module index sorting.
|
||||
#modindex_common_prefix = []
|
||||
# modindex_common_prefix = []
|
||||
|
||||
# If true, keep warnings as "system message" paragraphs in the built documents.
|
||||
#keep_warnings = False
|
||||
# keep_warnings = False
|
||||
|
||||
# If true, `todo` and `todoList` produce output, else they produce nothing.
|
||||
todo_include_todos = True
|
||||
|
@ -124,13 +124,13 @@ todo_include_todos = True
|
|||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
#html_theme = 'alabaster'
|
||||
#html_theme_path = ['../docsite/_themes']
|
||||
#html_theme = 'srtd'
|
||||
# html_theme = 'alabaster'
|
||||
# html_theme_path = ['../docsite/_themes']
|
||||
# html_theme = 'srtd'
|
||||
html_short_title = 'Ansible Documentation'
|
||||
|
||||
#html_theme = "sphinx_rtd_theme"
|
||||
#html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
|
||||
# html_theme = "sphinx_rtd_theme"
|
||||
# html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
|
||||
|
||||
html_theme_path = [alabaster.get_path()]
|
||||
html_theme = 'alabaster'
|
||||
|
@ -138,26 +138,26 @@ html_theme = 'alabaster'
|
|||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
# documentation.
|
||||
#html_theme_options = {}
|
||||
# html_theme_options = {}
|
||||
|
||||
# Add any paths that contain custom themes here, relative to this directory.
|
||||
#html_theme_path = []
|
||||
# html_theme_path = []
|
||||
|
||||
# The name for this set of Sphinx documents. If None, it defaults to
|
||||
# "<project> v<release> documentation".
|
||||
#html_title = None
|
||||
# html_title = None
|
||||
|
||||
# A shorter title for the navigation bar. Default is the same as html_title.
|
||||
#html_short_title = None
|
||||
# html_short_title = None
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top
|
||||
# of the sidebar.
|
||||
#html_logo = None
|
||||
# html_logo = None
|
||||
|
||||
# The name of an image file (relative to this directory) to use as a favicon of
|
||||
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||
# pixels large.
|
||||
#html_favicon = None
|
||||
# html_favicon = None
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
|
@ -167,62 +167,62 @@ html_static_path = ['_static']
|
|||
# Add any extra paths that contain custom files (such as robots.txt or
|
||||
# .htaccess) here, relative to this directory. These files are copied
|
||||
# directly to the root of the documentation.
|
||||
#html_extra_path = []
|
||||
# html_extra_path = []
|
||||
|
||||
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
||||
# using the given strftime format.
|
||||
#html_last_updated_fmt = '%b %d, %Y'
|
||||
# html_last_updated_fmt = '%b %d, %Y'
|
||||
|
||||
# If true, SmartyPants will be used to convert quotes and dashes to
|
||||
# typographically correct entities.
|
||||
#html_use_smartypants = True
|
||||
# html_use_smartypants = True
|
||||
|
||||
# Custom sidebar templates, maps document names to template names.
|
||||
#html_sidebars = {}
|
||||
# html_sidebars = {}
|
||||
|
||||
# Additional templates that should be rendered to pages, maps page names to
|
||||
# template names.
|
||||
#html_additional_pages = {}
|
||||
# html_additional_pages = {}
|
||||
|
||||
# If false, no module index is generated.
|
||||
#html_domain_indices = True
|
||||
# html_domain_indices = True
|
||||
|
||||
# If false, no index is generated.
|
||||
#html_use_index = True
|
||||
# html_use_index = True
|
||||
|
||||
# If true, the index is split into individual pages for each letter.
|
||||
#html_split_index = False
|
||||
# html_split_index = False
|
||||
|
||||
# If true, links to the reST sources are added to the pages.
|
||||
#html_show_sourcelink = True
|
||||
# html_show_sourcelink = True
|
||||
|
||||
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
|
||||
#html_show_sphinx = True
|
||||
# html_show_sphinx = True
|
||||
|
||||
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
|
||||
#html_show_copyright = True
|
||||
# html_show_copyright = True
|
||||
|
||||
# If true, an OpenSearch description file will be output, and all pages will
|
||||
# contain a <link> tag referring to it. The value of this option must be the
|
||||
# base URL from which the finished HTML is served.
|
||||
#html_use_opensearch = ''
|
||||
# html_use_opensearch = ''
|
||||
|
||||
# This is the file name suffix for HTML files (e.g. ".xhtml").
|
||||
#html_file_suffix = None
|
||||
# html_file_suffix = None
|
||||
|
||||
# Language to be used for generating the HTML full-text search index.
|
||||
# Sphinx supports the following languages:
|
||||
# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
|
||||
# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr'
|
||||
#html_search_language = 'en'
|
||||
# html_search_language = 'en'
|
||||
|
||||
# A dictionary with options for the search language support, empty by default.
|
||||
# Now only 'ja' uses this config value
|
||||
#html_search_options = {'type': 'default'}
|
||||
# html_search_options = {'type': 'default'}
|
||||
|
||||
# The name of a javascript file (relative to the configuration directory) that
|
||||
# implements a search results scorer. If empty, the default will be used.
|
||||
#html_search_scorer = 'scorer.js'
|
||||
# html_search_scorer = 'scorer.js'
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = 'Ansibledoc'
|
||||
|
@ -231,16 +231,16 @@ htmlhelp_basename = 'Ansibledoc'
|
|||
|
||||
latex_elements = {
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#'papersize': 'letterpaper',
|
||||
# 'papersize': 'letterpaper',
|
||||
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#'pointsize': '10pt',
|
||||
# 'pointsize': '10pt',
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#'preamble': '',
|
||||
# 'preamble': '',
|
||||
|
||||
# Latex figure (float) alignment
|
||||
#'figure_align': 'htbp',
|
||||
# 'figure_align': 'htbp',
|
||||
}
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
|
@ -253,23 +253,23 @@ latex_documents = [
|
|||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
# the title page.
|
||||
#latex_logo = None
|
||||
# latex_logo = None
|
||||
|
||||
# For "manual" documents, if this is true, then toplevel headings are parts,
|
||||
# not chapters.
|
||||
#latex_use_parts = False
|
||||
# latex_use_parts = False
|
||||
|
||||
# If true, show page references after internal links.
|
||||
#latex_show_pagerefs = False
|
||||
# latex_show_pagerefs = False
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#latex_show_urls = False
|
||||
# latex_show_urls = False
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#latex_appendices = []
|
||||
# latex_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#latex_domain_indices = True
|
||||
# latex_domain_indices = True
|
||||
|
||||
|
||||
# -- Options for manual page output ---------------------------------------
|
||||
|
@ -282,7 +282,7 @@ man_pages = [
|
|||
]
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#man_show_urls = False
|
||||
# man_show_urls = False
|
||||
|
||||
|
||||
# -- Options for Texinfo output -------------------------------------------
|
||||
|
@ -297,13 +297,13 @@ texinfo_documents = [
|
|||
]
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#texinfo_appendices = []
|
||||
# texinfo_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#texinfo_domain_indices = True
|
||||
# texinfo_domain_indices = True
|
||||
|
||||
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
||||
#texinfo_show_urls = 'footnote'
|
||||
# texinfo_show_urls = 'footnote'
|
||||
|
||||
# If true, do not generate a @detailmenu in the "Top" node's menu.
|
||||
#texinfo_no_detailmenu = False
|
||||
# texinfo_no_detailmenu = False
|
||||
|
|
|
@ -13,7 +13,7 @@ from ansible.playbook.task import Task
|
|||
template_file = 'playbooks_keywords.rst.j2'
|
||||
oblist = {}
|
||||
clist = []
|
||||
class_list = [ Play, Role, Block, Task ]
|
||||
class_list = [Play, Role, Block, Task]
|
||||
|
||||
p = optparse.OptionParser(
|
||||
version='%prog 1.0',
|
||||
|
@ -62,8 +62,8 @@ for aclass in class_list:
|
|||
|
||||
env = Environment(loader=FileSystemLoader(options.template_dir), trim_blocks=True,)
|
||||
template = env.get_template(template_file)
|
||||
outputname = options.output_dir + template_file.replace('.j2','')
|
||||
tempvars = { 'oblist': oblist, 'clist': clist }
|
||||
outputname = options.output_dir + template_file.replace('.j2', '')
|
||||
tempvars = {'oblist': oblist, 'clist': clist}
|
||||
|
||||
with open( outputname, 'w') as f:
|
||||
with open(outputname, 'w') as f:
|
||||
f.write(template.render(tempvars))
|
||||
|
|
|
@ -16,22 +16,21 @@
|
|||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
from __future__ import print_function
|
||||
__metaclass__ = type
|
||||
|
||||
import os
|
||||
import glob
|
||||
import sys
|
||||
import yaml
|
||||
import re
|
||||
import optparse
|
||||
import datetime
|
||||
import cgi
|
||||
import datetime
|
||||
import glob
|
||||
import optparse
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import warnings
|
||||
from collections import defaultdict
|
||||
import yaml
|
||||
|
||||
from collections import defaultdict
|
||||
from jinja2 import Environment, FileSystemLoader
|
||||
from six import iteritems
|
||||
|
||||
|
@ -47,23 +46,23 @@ from ansible.utils import plugin_docs
|
|||
TO_OLD_TO_BE_NOTABLE = 1.3
|
||||
|
||||
# Get parent directory of the directory this script lives in
|
||||
MODULEDIR=os.path.abspath(os.path.join(
|
||||
MODULEDIR = os.path.abspath(os.path.join(
|
||||
os.path.dirname(os.path.realpath(__file__)), os.pardir, 'lib', 'ansible', 'modules'
|
||||
))
|
||||
|
||||
# The name of the DOCUMENTATION template
|
||||
EXAMPLE_YAML=os.path.abspath(os.path.join(
|
||||
EXAMPLE_YAML = os.path.abspath(os.path.join(
|
||||
os.path.dirname(os.path.realpath(__file__)), os.pardir, 'examples', 'DOCUMENTATION.yml'
|
||||
))
|
||||
|
||||
_ITALIC = re.compile(r"I\(([^)]+)\)")
|
||||
_BOLD = re.compile(r"B\(([^)]+)\)")
|
||||
_BOLD = re.compile(r"B\(([^)]+)\)")
|
||||
_MODULE = re.compile(r"M\(([^)]+)\)")
|
||||
_URL = re.compile(r"U\(([^)]+)\)")
|
||||
_CONST = re.compile(r"C\(([^)]+)\)")
|
||||
_URL = re.compile(r"U\(([^)]+)\)")
|
||||
_CONST = re.compile(r"C\(([^)]+)\)")
|
||||
|
||||
DEPRECATED = b" (D)"
|
||||
#####################################################################################
|
||||
|
||||
|
||||
def rst_ify(text):
|
||||
''' convert symbols like I(this is in italics) to valid restructured text '''
|
||||
|
@ -79,7 +78,6 @@ def rst_ify(text):
|
|||
|
||||
return t
|
||||
|
||||
#####################################################################################
|
||||
|
||||
def html_ify(text):
|
||||
''' convert symbols like I(this is in italics) to valid HTML '''
|
||||
|
@ -94,36 +92,30 @@ def html_ify(text):
|
|||
return t
|
||||
|
||||
|
||||
#####################################################################################
|
||||
|
||||
def rst_fmt(text, fmt):
|
||||
''' helper for Jinja2 to do format strings '''
|
||||
|
||||
return fmt % (text)
|
||||
|
||||
#####################################################################################
|
||||
|
||||
def rst_xline(width, char="="):
|
||||
''' return a restructured text line of a given length '''
|
||||
|
||||
return char * width
|
||||
|
||||
#####################################################################################
|
||||
|
||||
def write_data(text, options, outputname, module):
|
||||
''' dumps module output to a file or the screen, as requested '''
|
||||
|
||||
if options.output_dir is not None:
|
||||
fname = os.path.join(options.output_dir, outputname % module)
|
||||
fname = fname.replace(".py","")
|
||||
fname = fname.replace(".py", "")
|
||||
f = open(fname, 'wb')
|
||||
f.write(to_bytes(text))
|
||||
f.close()
|
||||
else:
|
||||
print(text)
|
||||
|
||||
#####################################################################################
|
||||
|
||||
|
||||
def list_modules(module_dir, depth=0):
|
||||
''' returns a hash of categories, each category being a hash of module names to file paths '''
|
||||
|
@ -163,7 +155,7 @@ def list_modules(module_dir, depth=0):
|
|||
continue
|
||||
if module.startswith("_") and os.path.islink(module_path):
|
||||
source = os.path.splitext(os.path.basename(os.path.realpath(module_path)))[0]
|
||||
module = module.replace("_","",1)
|
||||
module = module.replace("_", "", 1)
|
||||
aliases[source].add(module)
|
||||
continue
|
||||
|
||||
|
@ -176,7 +168,6 @@ def list_modules(module_dir, depth=0):
|
|||
|
||||
return module_info, categories, aliases
|
||||
|
||||
#####################################################################################
|
||||
|
||||
def generate_parser():
|
||||
''' generate an optparse parser '''
|
||||
|
@ -197,15 +188,13 @@ def generate_parser():
|
|||
p.add_option('-V', action='version', help='Show version number and exit')
|
||||
return p
|
||||
|
||||
#####################################################################################
|
||||
|
||||
def jinja2_environment(template_dir, typ):
|
||||
|
||||
env = Environment(loader=FileSystemLoader(template_dir),
|
||||
variable_start_string="@{",
|
||||
variable_end_string="}@",
|
||||
trim_blocks=True,
|
||||
)
|
||||
variable_start_string="@{",
|
||||
variable_end_string="}@",
|
||||
trim_blocks=True)
|
||||
env.globals['xline'] = rst_xline
|
||||
|
||||
if typ == 'rst':
|
||||
|
@ -220,7 +209,7 @@ def jinja2_environment(template_dir, typ):
|
|||
|
||||
return env, template, outputname
|
||||
|
||||
#####################################################################################
|
||||
|
||||
def too_old(added):
|
||||
if not added:
|
||||
return False
|
||||
|
@ -233,6 +222,7 @@ def too_old(added):
|
|||
return False
|
||||
return (added_float < TO_OLD_TO_BE_NOTABLE)
|
||||
|
||||
|
||||
def process_module(module, options, env, template, outputname, module_map, aliases):
|
||||
|
||||
fname = module_map[module]
|
||||
|
@ -249,7 +239,7 @@ def process_module(module, options, env, template, outputname, module_map, alias
|
|||
if os.path.islink(fname):
|
||||
return # ignore, its an alias
|
||||
deprecated = True
|
||||
module = module.replace("_","",1)
|
||||
module = module.replace("_", "", 1)
|
||||
|
||||
print("rendering: %s" % module)
|
||||
|
||||
|
@ -271,7 +261,7 @@ def process_module(module, options, env, template, outputname, module_map, alias
|
|||
|
||||
all_keys = []
|
||||
|
||||
if not 'version_added' in doc:
|
||||
if 'version_added' not in doc:
|
||||
sys.exit("*** ERROR: missing version_added in: %s ***\n" % module)
|
||||
|
||||
added = 0
|
||||
|
@ -285,39 +275,39 @@ def process_module(module, options, env, template, outputname, module_map, alias
|
|||
del doc['version_added']
|
||||
|
||||
if 'options' in doc and doc['options']:
|
||||
for (k,v) in iteritems(doc['options']):
|
||||
for (k, v) in iteritems(doc['options']):
|
||||
# don't show version added information if it's too old to be called out
|
||||
if 'version_added' in doc['options'][k] and too_old(doc['options'][k]['version_added']):
|
||||
del doc['options'][k]['version_added']
|
||||
if not 'description' in doc['options'][k]:
|
||||
if 'description' not in doc['options'][k]:
|
||||
raise AnsibleError("Missing required description for option %s in %s " % (k, module))
|
||||
|
||||
required_value = doc['options'][k].get('required', False)
|
||||
if not isinstance(required_value, bool):
|
||||
raise AnsibleError("Invalid required value '%s' for option '%s' in '%s' (must be truthy)" % (required_value, k, module))
|
||||
if not isinstance(doc['options'][k]['description'],list):
|
||||
if not isinstance(doc['options'][k]['description'], list):
|
||||
doc['options'][k]['description'] = [doc['options'][k]['description']]
|
||||
|
||||
all_keys.append(k)
|
||||
|
||||
all_keys = sorted(all_keys)
|
||||
|
||||
doc['option_keys'] = all_keys
|
||||
doc['filename'] = fname
|
||||
doc['docuri'] = doc['module'].replace('_', '-')
|
||||
doc['now_date'] = datetime.date.today().strftime('%Y-%m-%d')
|
||||
doc['ansible_version'] = options.ansible_version
|
||||
doc['plainexamples'] = examples #plain text
|
||||
doc['metadata'] = metadata
|
||||
doc['option_keys'] = all_keys
|
||||
doc['filename'] = fname
|
||||
doc['docuri'] = doc['module'].replace('_', '-')
|
||||
doc['now_date'] = datetime.date.today().strftime('%Y-%m-%d')
|
||||
doc['ansible_version'] = options.ansible_version
|
||||
doc['plainexamples'] = examples # plain text
|
||||
doc['metadata'] = metadata
|
||||
|
||||
if returndocs:
|
||||
try:
|
||||
doc['returndocs'] = yaml.safe_load(returndocs)
|
||||
doc['returndocs'] = yaml.safe_load(returndocs)
|
||||
except:
|
||||
print("could not load yaml: %s" % returndocs)
|
||||
raise
|
||||
else:
|
||||
doc['returndocs'] = None
|
||||
doc['returndocs'] = None
|
||||
|
||||
# here is where we build the table of contents...
|
||||
|
||||
|
@ -328,7 +318,6 @@ def process_module(module, options, env, template, outputname, module_map, alias
|
|||
write_data(text, options, outputname, module)
|
||||
return doc['short_description']
|
||||
|
||||
#####################################################################################
|
||||
|
||||
def print_modules(module, category_file, deprecated, options, env, template, outputname, module_map, aliases):
|
||||
modstring = module
|
||||
|
@ -340,9 +329,10 @@ def print_modules(module, category_file, deprecated, options, env, template, out
|
|||
|
||||
category_file.write(b" %s - %s <%s_module>\n" % (to_bytes(modstring), to_bytes(rst_ify(module_map[module][1])), to_bytes(modname)))
|
||||
|
||||
|
||||
def process_category(category, categories, options, env, template, outputname):
|
||||
|
||||
### FIXME:
|
||||
# FIXME:
|
||||
# We no longer conceptually deal with a mapping of category names to
|
||||
# modules to file paths. Instead we want several different records:
|
||||
# (1) Mapping of module names to file paths (what's presently used
|
||||
|
@ -367,7 +357,7 @@ def process_category(category, categories, options, env, template, outputname):
|
|||
|
||||
# start a new category file
|
||||
|
||||
category = category.replace("_"," ")
|
||||
category = category.replace("_", " ")
|
||||
category = category.title()
|
||||
|
||||
modules = []
|
||||
|
@ -406,12 +396,12 @@ def process_category(category, categories, options, env, template, outputname):
|
|||
|
||||
sections.sort()
|
||||
for section in sections:
|
||||
category_file.write(b"\n%s\n%s\n\n" % (to_bytes(section.replace("_"," ").title()), b'-' * len(section)))
|
||||
category_file.write(b"\n%s\n%s\n\n" % (to_bytes(section.replace("_", " ").title()), b'-' * len(section)))
|
||||
category_file.write(b".. toctree:: :maxdepth: 1\n\n")
|
||||
|
||||
section_modules = list(module_map[section].keys())
|
||||
section_modules.sort(key=lambda k: k[1:] if k.startswith('_') else k)
|
||||
#for module in module_map[section]:
|
||||
# for module in module_map[section]:
|
||||
for module in (m for m in section_modules if m in module_info):
|
||||
print_modules(module, category_file, deprecated, options, env, template, outputname, module_info, aliases)
|
||||
|
||||
|
@ -424,7 +414,6 @@ def process_category(category, categories, options, env, template, outputname):
|
|||
|
||||
# TODO: end a new category file
|
||||
|
||||
#####################################################################################
|
||||
|
||||
def validate_options(options):
|
||||
''' validate option parser options '''
|
||||
|
@ -436,7 +425,6 @@ def validate_options(options):
|
|||
if not options.template_dir:
|
||||
sys.exit("--template-dir must be specified")
|
||||
|
||||
#####################################################################################
|
||||
|
||||
def main():
|
||||
|
||||
|
@ -465,9 +453,7 @@ def main():
|
|||
for category in category_names:
|
||||
category_list_file.write(b" list_of_%s_modules\n" % to_bytes(category))
|
||||
|
||||
#
|
||||
# Import all the docs into memory
|
||||
#
|
||||
module_map = mod_info.copy()
|
||||
|
||||
for modname in module_map:
|
||||
|
@ -477,11 +463,10 @@ def main():
|
|||
else:
|
||||
categories['all'][modname] = (categories['all'][modname], result)
|
||||
|
||||
#
|
||||
# Render all the docs to rst via category pages
|
||||
#
|
||||
for category in category_names:
|
||||
process_category(category, categories, options, env, template, outputname)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
|
@ -17,13 +17,13 @@ import sys
|
|||
import os
|
||||
|
||||
# pip install sphinx_rtd_theme
|
||||
#import sphinx_rtd_theme
|
||||
#html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
|
||||
# import sphinx_rtd_theme
|
||||
# html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
|
||||
|
||||
# If your extensions are in another directory, add it here. If the directory
|
||||
# is relative to the documentation root, use os.path.abspath to make it
|
||||
# absolute, like shown here.
|
||||
#sys.path.append(os.path.abspath('some/directory'))
|
||||
# sys.path.append(os.path.abspath('some/directory'))
|
||||
#
|
||||
sys.path.insert(0, os.path.join('ansible', 'lib'))
|
||||
sys.path.append(os.path.abspath('_themes'))
|
||||
|
@ -67,16 +67,16 @@ release = VERSION
|
|||
|
||||
# There are two options for replacing |today|: either, you set today to some
|
||||
# non-false value, then it is used:
|
||||
#today = ''
|
||||
# today = ''
|
||||
# Else, today_fmt is used as the format for a strftime call.
|
||||
today_fmt = '%B %d, %Y'
|
||||
|
||||
# List of documents that shouldn't be included in the build.
|
||||
#unused_docs = []
|
||||
# unused_docs = []
|
||||
|
||||
# List of directories, relative to source directories, that shouldn't be
|
||||
# searched for source files.
|
||||
#exclude_dirs = []
|
||||
# exclude_dirs = []
|
||||
|
||||
# A list of glob-style patterns that should be excluded when looking
|
||||
# for source files.
|
||||
|
@ -84,26 +84,26 @@ exclude_patterns = ['modules']
|
|||
|
||||
# The reST default role (used for this markup: `text`) to use for all
|
||||
# documents.
|
||||
#default_role = None
|
||||
# default_role = None
|
||||
|
||||
# If true, '()' will be appended to :func: etc. cross-reference text.
|
||||
#add_function_parentheses = True
|
||||
# add_function_parentheses = True
|
||||
|
||||
# If true, the current module name will be prepended to all description
|
||||
# unit titles (such as .. function::).
|
||||
#add_module_names = True
|
||||
# add_module_names = True
|
||||
|
||||
# If true, sectionauthor and moduleauthor directives will be shown in the
|
||||
# output. They are ignored by default.
|
||||
#show_authors = False
|
||||
# show_authors = False
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = 'sphinx'
|
||||
|
||||
highlight_language = 'YAML+Jinja'
|
||||
|
||||
#Substitutions, variables, entities, & shortcuts for text which do not need to link to anything.
|
||||
#For titles which should be a link, use the intersphinx anchors set at the index, chapter, and section levels, such as qi_start_:
|
||||
# Substitutions, variables, entities, & shortcuts for text which do not need to link to anything.
|
||||
# For titles which should be a link, use the intersphinx anchors set at the index, chapter, and section levels, such as qi_start_:
|
||||
rst_epilog = """
|
||||
.. |acapi| replace:: *Ansible Core API Guide*
|
||||
.. |acrn| replace:: *Ansible Core Release Notes*
|
||||
|
@ -128,28 +128,28 @@ html_short_title = 'Ansible Documentation'
|
|||
# The style sheet to use for HTML and HTML Help pages. A file of that name
|
||||
# must exist either in Sphinx' static/ path, or in one of the custom paths
|
||||
# given in html_static_path.
|
||||
#html_style = 'solar.css'
|
||||
# html_style = 'solar.css'
|
||||
|
||||
# The name for this set of Sphinx documents. If None, it defaults to
|
||||
# "<project> v<release> documentation".
|
||||
html_title = 'Ansible Documentation'
|
||||
|
||||
# A shorter title for the navigation bar. Default is the same as html_title.
|
||||
#html_short_title = None
|
||||
# html_short_title = None
|
||||
|
||||
# The name of an image file (within the static path) to place at the top of
|
||||
# the sidebar.
|
||||
#html_logo = None
|
||||
# html_logo = None
|
||||
|
||||
# The name of an image file (within the static path) to use as favicon of the
|
||||
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||
# pixels large.
|
||||
#html_favicon = 'favicon.ico'
|
||||
# html_favicon = 'favicon.ico'
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
#html_static_path = ['.static']
|
||||
# html_static_path = ['.static']
|
||||
|
||||
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
||||
# using the given strftime format.
|
||||
|
@ -157,23 +157,23 @@ html_last_updated_fmt = '%b %d, %Y'
|
|||
|
||||
# If true, SmartyPants will be used to convert quotes and dashes to
|
||||
# typographically correct entities.
|
||||
#html_use_smartypants = True
|
||||
# html_use_smartypants = True
|
||||
|
||||
# Custom sidebar templates, maps document names to template names.
|
||||
#html_sidebars = {}
|
||||
# html_sidebars = {}
|
||||
|
||||
# Additional templates that should be rendered to pages, maps page names to
|
||||
# template names.
|
||||
#html_additional_pages = {}
|
||||
# html_additional_pages = {}
|
||||
|
||||
# If false, no module index is generated.
|
||||
#html_use_modindex = True
|
||||
# html_use_modindex = True
|
||||
|
||||
# If false, no index is generated.
|
||||
#html_use_index = True
|
||||
# html_use_index = True
|
||||
|
||||
# If true, the index is split into individual pages for each letter.
|
||||
#html_split_index = False
|
||||
# html_split_index = False
|
||||
|
||||
# If true, the reST sources are included in the HTML build as _sources/<name>.
|
||||
html_copy_source = False
|
||||
|
@ -181,10 +181,10 @@ html_copy_source = False
|
|||
# If true, an OpenSearch description file will be output, and all pages will
|
||||
# contain a <link> tag referring to it. The value of this option must be the
|
||||
# base URL from which the finished HTML is served.
|
||||
#html_use_opensearch = ''
|
||||
# html_use_opensearch = ''
|
||||
|
||||
# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
|
||||
#html_file_suffix = ''
|
||||
# html_file_suffix = ''
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = 'Poseidodoc'
|
||||
|
@ -194,10 +194,10 @@ htmlhelp_basename = 'Poseidodoc'
|
|||
# ------------------------
|
||||
|
||||
# The paper size ('letter' or 'a4').
|
||||
#latex_paper_size = 'letter'
|
||||
# latex_paper_size = 'letter'
|
||||
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#latex_font_size = '10pt'
|
||||
# latex_font_size = '10pt'
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title, author, document class
|
||||
|
@ -208,20 +208,20 @@ latex_documents = [
|
|||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
# the title page.
|
||||
#latex_logo = None
|
||||
# latex_logo = None
|
||||
|
||||
# For "manual" documents, if this is true, then toplevel headings are parts,
|
||||
# not chapters.
|
||||
#latex_use_parts = False
|
||||
# latex_use_parts = False
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#latex_preamble = ''
|
||||
# latex_preamble = ''
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#latex_appendices = []
|
||||
# latex_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#latex_use_modindex = True
|
||||
# latex_use_modindex = True
|
||||
|
||||
autoclass_content = 'both'
|
||||
|
||||
|
|
|
@ -1,11 +1,6 @@
|
|||
contrib/inventory/freeipa.py
|
||||
contrib/inventory/rackhd.py
|
||||
contrib/inventory/vmware_inventory.py
|
||||
docs/api/conf.py
|
||||
docs/bin/dump_keywords.py
|
||||
docs/bin/plugin_formatter.py
|
||||
docs/docsite/rst/conf.py
|
||||
docs/docsite/rst/intro_inventory.rst
|
||||
lib/ansible/cli/__init__.py
|
||||
lib/ansible/cli/adhoc.py
|
||||
lib/ansible/cli/console.py
|
||||
|
|
Loading…
Reference in a new issue