Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module_formatter: .rst now correctly handles code examples #1372

Merged
merged 1 commit into from
Oct 18, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions hacking/templates/man.j2
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
.SH EXAMPLES
{% for e in examples %}
.PP
{% if e['description'] %}
@{ e['description'] | jpfunc }@
{% endif %}

.nf
@{ e['code'] }@
.fi
Expand Down
8 changes: 5 additions & 3 deletions hacking/templates/rst.j2
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@

{% for example in examples %}
{% if example['description'] %}<p>@{ example['description'] | html_ify }@</p>{% endif %}
<p><pre>
@{ example['code'] }@
</pre></p>
<p>
<pre>
@{ example['code'] | indent(4, True) }@
</pre>
</p>
{% endfor %}
<br/>

Expand Down
2 changes: 1 addition & 1 deletion library/cron
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ options:
examples:
- code: cron name="check dirs" hour="5,2" job="ls -alh > /dev/null"
description: Ensure a job that runs at 2 and 5 exists. Creates an entry like "* 5,2 * * ls -alh > /dev/null"
- code: name="an old job" cron job="/some/dir/job.sh" state=absent
- code: cron name="an old job" cron job="/some/dir/job.sh" state=absent
description: 'Ensure an old job is no longer present. Removes any job that is preceded by "#Ansible: an old job" in the crontab'
requirements: cron
author: Dane Summers
Expand Down
2 changes: 1 addition & 1 deletion library/debug
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ options:
required: false
default: "no"
examples:
- code:
- code: |
- local_action: debug msg="System $inventory_hostname has uuid $ansible_product_uuid"
- local_action: debug msg="System $inventory_hostname lacks a gateway" fail=yes
only_if: "is_unset('${ansible_default_ipv4.gateway}')"
Expand Down
3 changes: 1 addition & 2 deletions library/fireball
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ examples:
sudo: yes
tasks:
- action: fireball
- hosts: devservers
- hosts: devservers
connection: fireball
tasks:
- action: command /usr/bin/anything
Expand Down