diff --git a/docsite/Makefile b/docsite/Makefile index 56b84fbc88b..39b3cc647ee 100644 --- a/docsite/Makefile +++ b/docsite/Makefile @@ -27,6 +27,6 @@ clean: .PHONEY: docs clean modules: $(FORMATTER) ../hacking/templates/rst.j2 - PYTHONPATH=../lib $(FORMATTER) -t rst --template-dir=../hacking/templates --module-dir=../library -o rst/modules/ --includes-file=rst/modules/_list.rst + PYTHONPATH=../lib $(FORMATTER) -t rst --template-dir=../hacking/templates --module-dir=../library -o rst/modules/ --includes-file=rst/modules/_categories.rst diff --git a/docsite/rst/modules.rst b/docsite/rst/modules.rst index ac922c965cc..3348d2b8043 100644 --- a/docsite/rst/modules.rst +++ b/docsite/rst/modules.rst @@ -54,8 +54,7 @@ ansible-doc as well as the man command:: Let's see what's available in the Ansible module library, out of the box: - -.. include:: modules/_list.rst +.. include:: modules/_categories.rst .. _ansible_doc: diff --git a/hacking/module_formatter.py b/hacking/module_formatter.py index 35fde1b1f65..70665892367 100755 --- a/hacking/module_formatter.py +++ b/hacking/module_formatter.py @@ -264,25 +264,25 @@ def main(): env.globals['xline'] = rst_xline if options.type == 'latex': - env.filters['jpfunc'] = latex_ify + env.filters['convert_symbols_to_format'] = latex_ify template = env.get_template('latex.j2') outputname = "%s.tex" includecmt = "" includefmt = "%s\n" if options.type == 'html': - env.filters['jpfunc'] = html_ify + env.filters['convert_symbols_to_format'] = html_ify template = env.get_template('html.j2') outputname = "%s.html" includecmt = "" includefmt = "" if options.type == 'man': - env.filters['jpfunc'] = man_ify + env.filters['convert_symbols_to_format'] = man_ify template = env.get_template('man.j2') outputname = "ansible.%s.3" includecmt = "" includefmt = "" if options.type == 'rst': - env.filters['jpfunc'] = rst_ify + env.filters['convert_symbols_to_format'] = rst_ify env.filters['html_ify'] = html_ify env.filters['fmt'] = rst_fmt env.filters['xline'] = rst_xline @@ -291,16 +291,16 @@ def main(): includecmt = ".. Generated by module_formatter\n" includefmt = ".. include:: modules/%s.rst\n" if options.type == 'json': - env.filters['jpfunc'] = json_ify + env.filters['convert_symbols_to_format'] = json_ify outputname = "%s.json" includecmt = "" includefmt = "" if options.type == 'js': - env.filters['jpfunc'] = js_ify + env.filters['convert_symbols_to_format'] = js_ify template = env.get_template('js.j2') outputname = "%s.js" if options.type == 'markdown': - env.filters['jpfunc'] = markdown_ify + env.filters['convert_symbols_to_format'] = markdown_ify env.filters['html_ify'] = html_ify template = env.get_template('markdown.j2') outputname = "%s.md" @@ -320,7 +320,8 @@ def main(): category_names.sort() for category in category_names: - module_map = categories[category] + + module_map = categories[category] category = category.replace("_"," ") category = category.title() diff --git a/hacking/templates/html.j2 b/hacking/templates/html.j2 index b86e47378b8..f80018bb6dc 100644 --- a/hacking/templates/html.j2 +++ b/hacking/templates/html.j2 @@ -3,5 +3,5 @@

@{module}@

{% for desc in description -%} - @{ desc | jpfunc }@ + @{ desc | convert_symbols_to_format }@ {% endfor %} diff --git a/hacking/templates/latex.j2 b/hacking/templates/latex.j2 index d02ffa8677f..5905477d609 100644 --- a/hacking/templates/latex.j2 +++ b/hacking/templates/latex.j2 @@ -8,7 +8,7 @@ %: -- module header \mods{@{module}@}{@{docuri}@}{ {% for desc in description -%} - @{ desc | jpfunc }@ + @{ desc | convert_symbols_to_format }@ {% endfor -%} {% if version_added is defined -%} (\I{* new in version @{ version_added }@}) @@ -30,7 +30,7 @@ {# -------- option description ----------#} {% for desc in v.description %} - @{ desc | jpfunc }@ + @{ desc | convert_symbols_to_format }@ {% endfor %} {% if v['choices'] %} \B{Choices}:\, @@ -51,7 +51,7 @@ {% if notes %} {% for note in notes %} - \I{@{ note | jpfunc }@} + \I{@{ note | convert_symbols_to_format }@} {% endfor %} {% endif %} ----------------------------- #} diff --git a/hacking/templates/man.j2 b/hacking/templates/man.j2 index 6cf51960aef..c85b14a2b10 100644 --- a/hacking/templates/man.j2 +++ b/hacking/templates/man.j2 @@ -6,7 +6,7 @@ .SH DESCRIPTION {% for desc in description %} .PP -@{ desc | jpfunc }@ +@{ desc | convert_symbols_to_format }@ {% endfor %} .\" ------ OPTIONS .\" @@ -17,7 +17,7 @@ {% set v = options[k] %} .IP @{ k }@ -{% for desc in v.description %}@{ desc | jpfunc }@{% endfor %} +{% for desc in v.description %}@{ desc | convert_symbols_to_format }@{% endfor %} {% if v.get('choices') %} .IR Choices : @@ -37,7 +37,7 @@ .SH NOTES {% for note in notes %} .PP -@{ note | jpfunc }@ +@{ note | convert_symbols_to_format }@ {% endfor %} {% endif %} .\" @@ -48,7 +48,7 @@ {% for e in examples %} .PP {% if e['description'] %} -@{ e['description'] | jpfunc }@ +@{ e['description'] | convert_symbols_to_format }@ {% endif %} .nf diff --git a/hacking/templates/markdown.j2 b/hacking/templates/markdown.j2 index 6f9bb0b3d88..a734ece3ec9 100644 --- a/hacking/templates/markdown.j2 +++ b/hacking/templates/markdown.j2 @@ -1,4 +1,4 @@ -## @{ module | jpfunc }@ +## @{ module | convert_symbols_to_format }@ {# ------------------------------------------ # @@ -11,7 +11,7 @@ New in version @{ version_added }@. {% endif %} {% for desc in description -%} -@{ desc | jpfunc }@ +@{ desc | convert_symbols_to_format }@ {% endfor %} @@ -42,7 +42,7 @@ New in version @{ version_added }@. {% for example in examples %} {% if example['description'] %} -* @{ example['description'] | jpfunc }@ +* @{ example['description'] | convert_symbols_to_format }@ {% endif %} ``` @@ -58,7 +58,7 @@ New in version @{ version_added }@. {% if notes %} #### Notes {% for note in notes %} -@{ note | jpfunc }@ +@{ note | convert_symbols_to_format }@ {% endfor %} {% endif %} diff --git a/hacking/templates/rst.j2 b/hacking/templates/rst.j2 index b4afcd1cab3..556ea1e36c9 100644 --- a/hacking/templates/rst.j2 +++ b/hacking/templates/rst.j2 @@ -15,7 +15,7 @@ {% endif %} {% for desc in description -%} -@{ desc | jpfunc }@ +@{ desc | convert_symbols_to_format }@ {% endfor %} {% if options -%}