mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Starting to refactor module formatter script.
Rename "jpfunc" to something more explanatory
This commit is contained in:
parent
c44b876c82
commit
10009b0d3f
8 changed files with 24 additions and 24 deletions
|
@ -27,6 +27,6 @@ clean:
|
||||||
.PHONEY: docs clean
|
.PHONEY: docs clean
|
||||||
|
|
||||||
modules: $(FORMATTER) ../hacking/templates/rst.j2
|
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
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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:
|
Let's see what's available in the Ansible module library, out of the box:
|
||||||
|
|
||||||
|
.. include:: modules/_categories.rst
|
||||||
.. include:: modules/_list.rst
|
|
||||||
|
|
||||||
.. _ansible_doc:
|
.. _ansible_doc:
|
||||||
|
|
||||||
|
|
|
@ -264,25 +264,25 @@ def main():
|
||||||
env.globals['xline'] = rst_xline
|
env.globals['xline'] = rst_xline
|
||||||
|
|
||||||
if options.type == 'latex':
|
if options.type == 'latex':
|
||||||
env.filters['jpfunc'] = latex_ify
|
env.filters['convert_symbols_to_format'] = latex_ify
|
||||||
template = env.get_template('latex.j2')
|
template = env.get_template('latex.j2')
|
||||||
outputname = "%s.tex"
|
outputname = "%s.tex"
|
||||||
includecmt = ""
|
includecmt = ""
|
||||||
includefmt = "%s\n"
|
includefmt = "%s\n"
|
||||||
if options.type == 'html':
|
if options.type == 'html':
|
||||||
env.filters['jpfunc'] = html_ify
|
env.filters['convert_symbols_to_format'] = html_ify
|
||||||
template = env.get_template('html.j2')
|
template = env.get_template('html.j2')
|
||||||
outputname = "%s.html"
|
outputname = "%s.html"
|
||||||
includecmt = ""
|
includecmt = ""
|
||||||
includefmt = ""
|
includefmt = ""
|
||||||
if options.type == 'man':
|
if options.type == 'man':
|
||||||
env.filters['jpfunc'] = man_ify
|
env.filters['convert_symbols_to_format'] = man_ify
|
||||||
template = env.get_template('man.j2')
|
template = env.get_template('man.j2')
|
||||||
outputname = "ansible.%s.3"
|
outputname = "ansible.%s.3"
|
||||||
includecmt = ""
|
includecmt = ""
|
||||||
includefmt = ""
|
includefmt = ""
|
||||||
if options.type == 'rst':
|
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['html_ify'] = html_ify
|
||||||
env.filters['fmt'] = rst_fmt
|
env.filters['fmt'] = rst_fmt
|
||||||
env.filters['xline'] = rst_xline
|
env.filters['xline'] = rst_xline
|
||||||
|
@ -291,16 +291,16 @@ def main():
|
||||||
includecmt = ".. Generated by module_formatter\n"
|
includecmt = ".. Generated by module_formatter\n"
|
||||||
includefmt = ".. include:: modules/%s.rst\n"
|
includefmt = ".. include:: modules/%s.rst\n"
|
||||||
if options.type == 'json':
|
if options.type == 'json':
|
||||||
env.filters['jpfunc'] = json_ify
|
env.filters['convert_symbols_to_format'] = json_ify
|
||||||
outputname = "%s.json"
|
outputname = "%s.json"
|
||||||
includecmt = ""
|
includecmt = ""
|
||||||
includefmt = ""
|
includefmt = ""
|
||||||
if options.type == 'js':
|
if options.type == 'js':
|
||||||
env.filters['jpfunc'] = js_ify
|
env.filters['convert_symbols_to_format'] = js_ify
|
||||||
template = env.get_template('js.j2')
|
template = env.get_template('js.j2')
|
||||||
outputname = "%s.js"
|
outputname = "%s.js"
|
||||||
if options.type == 'markdown':
|
if options.type == 'markdown':
|
||||||
env.filters['jpfunc'] = markdown_ify
|
env.filters['convert_symbols_to_format'] = markdown_ify
|
||||||
env.filters['html_ify'] = html_ify
|
env.filters['html_ify'] = html_ify
|
||||||
template = env.get_template('markdown.j2')
|
template = env.get_template('markdown.j2')
|
||||||
outputname = "%s.md"
|
outputname = "%s.md"
|
||||||
|
@ -320,6 +320,7 @@ def main():
|
||||||
category_names.sort()
|
category_names.sort()
|
||||||
|
|
||||||
for category in category_names:
|
for category in category_names:
|
||||||
|
|
||||||
module_map = categories[category]
|
module_map = categories[category]
|
||||||
|
|
||||||
category = category.replace("_"," ")
|
category = category.replace("_"," ")
|
||||||
|
|
|
@ -3,5 +3,5 @@
|
||||||
<h2>@{module}@</h2>
|
<h2>@{module}@</h2>
|
||||||
|
|
||||||
{% for desc in description -%}
|
{% for desc in description -%}
|
||||||
@{ desc | jpfunc }@
|
@{ desc | convert_symbols_to_format }@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
%: -- module header
|
%: -- module header
|
||||||
\mods{@{module}@}{@{docuri}@}{
|
\mods{@{module}@}{@{docuri}@}{
|
||||||
{% for desc in description -%}
|
{% for desc in description -%}
|
||||||
@{ desc | jpfunc }@
|
@{ desc | convert_symbols_to_format }@
|
||||||
{% endfor -%}
|
{% endfor -%}
|
||||||
{% if version_added is defined -%}
|
{% if version_added is defined -%}
|
||||||
(\I{* new in version @{ version_added }@})
|
(\I{* new in version @{ version_added }@})
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
{# -------- option description ----------#}
|
{# -------- option description ----------#}
|
||||||
{% for desc in v.description %}
|
{% for desc in v.description %}
|
||||||
@{ desc | jpfunc }@
|
@{ desc | convert_symbols_to_format }@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if v['choices'] %}
|
{% if v['choices'] %}
|
||||||
\B{Choices}:\,
|
\B{Choices}:\,
|
||||||
|
@ -51,7 +51,7 @@
|
||||||
{% if notes %}
|
{% if notes %}
|
||||||
|
|
||||||
{% for note in notes %}
|
{% for note in notes %}
|
||||||
\I{@{ note | jpfunc }@}
|
\I{@{ note | convert_symbols_to_format }@}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
----------------------------- #}
|
----------------------------- #}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
{% for desc in description %}
|
{% for desc in description %}
|
||||||
.PP
|
.PP
|
||||||
@{ desc | jpfunc }@
|
@{ desc | convert_symbols_to_format }@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
.\" ------ OPTIONS
|
.\" ------ OPTIONS
|
||||||
.\"
|
.\"
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
{% set v = options[k] %}
|
{% set v = options[k] %}
|
||||||
|
|
||||||
.IP @{ 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') %}
|
{% if v.get('choices') %}
|
||||||
|
|
||||||
.IR Choices :
|
.IR Choices :
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
.SH NOTES
|
.SH NOTES
|
||||||
{% for note in notes %}
|
{% for note in notes %}
|
||||||
.PP
|
.PP
|
||||||
@{ note | jpfunc }@
|
@{ note | convert_symbols_to_format }@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
.\"
|
.\"
|
||||||
|
@ -48,7 +48,7 @@
|
||||||
{% for e in examples %}
|
{% for e in examples %}
|
||||||
.PP
|
.PP
|
||||||
{% if e['description'] %}
|
{% if e['description'] %}
|
||||||
@{ e['description'] | jpfunc }@
|
@{ e['description'] | convert_symbols_to_format }@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
.nf
|
.nf
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
## @{ module | jpfunc }@
|
## @{ module | convert_symbols_to_format }@
|
||||||
|
|
||||||
{# ------------------------------------------
|
{# ------------------------------------------
|
||||||
#
|
#
|
||||||
|
@ -11,7 +11,7 @@ New in version @{ version_added }@.
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% for desc in description -%}
|
{% for desc in description -%}
|
||||||
@{ desc | jpfunc }@
|
@{ desc | convert_symbols_to_format }@
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ New in version @{ version_added }@.
|
||||||
|
|
||||||
{% for example in examples %}
|
{% for example in examples %}
|
||||||
{% if example['description'] %}
|
{% if example['description'] %}
|
||||||
* @{ example['description'] | jpfunc }@
|
* @{ example['description'] | convert_symbols_to_format }@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -58,7 +58,7 @@ New in version @{ version_added }@.
|
||||||
{% if notes %}
|
{% if notes %}
|
||||||
#### Notes
|
#### Notes
|
||||||
{% for note in notes %}
|
{% for note in notes %}
|
||||||
@{ note | jpfunc }@
|
@{ note | convert_symbols_to_format }@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% for desc in description -%}
|
{% for desc in description -%}
|
||||||
@{ desc | jpfunc }@
|
@{ desc | convert_symbols_to_format }@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% if options -%}
|
{% if options -%}
|
||||||
|
|
Loading…
Reference in a new issue