mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 20:31:27 -07:00
Move man pages generations to rst2man (#37861)
This commit is contained in:
parent
02f44176b9
commit
00a7ff7974
7 changed files with 40 additions and 38 deletions
|
@ -241,12 +241,12 @@ if __name__ == '__main__':
|
|||
if cli_name == 'adhoc':
|
||||
cli_class_name = 'AdHocCLI'
|
||||
# myclass = 'AdHocCLI'
|
||||
output[cli_name] = 'ansible.1.asciidoc.in'
|
||||
output[cli_name] = 'ansible.1.rst.in'
|
||||
cli_bin_name = 'ansible'
|
||||
else:
|
||||
# myclass = "%sCLI" % libname.capitalize()
|
||||
cli_class_name = "%sCLI" % cli_name.capitalize()
|
||||
output[cli_name] = 'ansible-%s.1.asciidoc.in' % cli_name
|
||||
output[cli_name] = 'ansible-%s.1.rst.in' % cli_name
|
||||
cli_bin_name = 'ansible-%s' % cli_name
|
||||
|
||||
# FIXME:
|
||||
|
@ -255,7 +255,7 @@ if __name__ == '__main__':
|
|||
|
||||
cli_list = allvars.keys()
|
||||
|
||||
doc_name_formats = {'man': '%s.1.asciidoc.in',
|
||||
doc_name_formats = {'man': '%s.1.rst.in',
|
||||
'rst': '%s.rst'}
|
||||
|
||||
for cli_name in cli_list:
|
||||
|
|
32
docs/templates/man.j2
vendored
32
docs/templates/man.j2
vendored
|
@ -1,16 +1,15 @@
|
|||
{% set name = ('ansible' if cli == 'adhoc' else 'ansible-%s' % cli) -%}
|
||||
{{name}}(1)
|
||||
{{ '=' * ((name|length|int) + 3) }}
|
||||
:doctype: manpage
|
||||
:encoding: utf-8
|
||||
:lang: en
|
||||
:man source: Ansible
|
||||
:man version: %VERSION%
|
||||
:man manual: System administration commands
|
||||
{{name}}
|
||||
{{ '=' * ( name|length|int ) }}
|
||||
|
||||
{{ '-' * ( short_desc|default('')|string|length|int ) }}
|
||||
{{short_desc|default('')}}
|
||||
{{ '-' * ( short_desc|default('')|string|length|int ) }}
|
||||
|
||||
:Version: Ansible %VERSION%
|
||||
:Manual section: 1
|
||||
:Manual group: System administration commands
|
||||
|
||||
NAME
|
||||
----
|
||||
ansible{% if cli != 'adhoc' %}-{{cli}}{% endif %} - {{short_desc|default('')}}
|
||||
|
||||
|
||||
SYNOPSIS
|
||||
|
@ -26,9 +25,9 @@ DESCRIPTION
|
|||
COMMON OPTIONS
|
||||
--------------
|
||||
{% for option in options|sort(attribute='options') %}
|
||||
{% for switch in option['options'] %}*{{switch}}*{% if option['arg'] %} '{{option['arg']}}'{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}::
|
||||
{% for switch in option['options'] %}**{{switch}}**{% if option['arg'] %} '{{option['arg']}}'{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}
|
||||
|
||||
{{ option['desc'] }}
|
||||
{{ option['desc'] }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
|
@ -48,11 +47,12 @@ ARGUMENTS
|
|||
ACTIONS
|
||||
-------
|
||||
{% for action in actions %}
|
||||
*{{ action }}*::: {{ (actions[action]['desc']|default(' '))|wordwrap}}
|
||||
**{{ action }}**
|
||||
{{ (actions[action]['desc']|default(' '))}}
|
||||
|
||||
{% if actions[action]['options'] %}
|
||||
{% for option in actions[action]['options']|sort(attribute='options') %}
|
||||
{% for switch in option['options'] if switch in actions[action]['option_names'] %}*{{switch}}*{% if option['arg'] %} '{{option['arg']}}'{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}::
|
||||
{% for switch in option['options'] if switch in actions[action]['option_names'] %}**{{switch}}**{% if option['arg'] %} '{{option['arg']}}'{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}
|
||||
|
||||
{{ (option['desc']) }}
|
||||
{% endfor %}
|
||||
|
@ -116,7 +116,7 @@ Ansible is released under the terms of the GPLv3 License.
|
|||
SEE ALSO
|
||||
--------
|
||||
|
||||
{% for other in cli_list|sort %}{% if other != cli %}*ansible{% if other != 'adhoc' %}-{{other}}{% endif %}*(1){% if not loop.last %}, {% endif %}{% endif %}{% endfor %}
|
||||
{% for other in cli_list|sort %}{% if other != cli %}**ansible{% if other != 'adhoc' %}-{{other}}{% endif %}** (1){% if not loop.last %}, {% endif %}{% endif %}{% endfor %}
|
||||
|
||||
Extensive documentation is available in the documentation site:
|
||||
<http://docs.ansible.com>.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue