ansible/hacking/templates/man.j2
Jan-Piet Mens 575459465e module_formatter: .rst now correctly handles code examples
- fixed template (it was the template), adding indentation with Jinja2
 - added description of code examples to man-page template (was missing)
 - fixed fireball, cron, and debug module examples to confrom
2012-10-18 13:49:19 +02:00

65 lines
1.4 KiB
Django/Jinja

.TH ANSIBLE.@{ module | upper }@ 3 "@{ now_date }@" "@{ ansible_version }@" "ANSIBLE MODULES"
." generated from @{ filename }@
.SH NAME
@{ module }@ \- @{ short_description }@
." ------ DESCRIPTION
.SH DESCRIPTION
{% for desc in description %}
.PP
@{ desc | jpfunc }@
{% endfor %}
." ------ OPTIONS
."
."
{% if options %}
.SH OPTIONS
{% for (k,v) in options.iteritems() %}
.IP @{ k }@
{% for desc in v.description %}@{ desc | jpfunc }@{% endfor %}
{% if v.get('choices') %}
.IR Choices :
{% for choice in v.get('choices',[]) %}@{ choice }@{% if not loop.last %},{%else%}.{%endif%}{% endfor %}{% endif %}
{% if v.get('required') %}(required){% endif %}
{% if v.get('default') %} (default: @{ v.get('default') }@){% endif %}
{#---------------------------------------------- #}
{% if v.get('version_added') %}
(Added in Ansible version @{ v.get('version_added') }@.)
{% endif %}
{% endfor %}
{% endif %}
."
."
." ------ NOTES
{% if notes %}
.SH NOTES
{% for note in notes %}
.PP
@{ note | jpfunc }@
{% endfor %}
{% endif %}
."
."
." ------ EXAMPLES
{% if examples is defined %}
.SH EXAMPLES
{% for e in examples %}
.PP
{% if e['description'] %}
@{ e['description'] | jpfunc }@
{% endif %}
.nf
@{ e['code'] }@
.fi
{% endfor %}
{% endif %}
." ------- AUTHOR
{% if author is defined %}
.SH AUTHOR
@{ author }@
{% endif %}
.SH SEE ALSO
.IR ansible (1),
.I http://ansible.github.com/modules.html#@{docuri}@