Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
71f77d15
Commit
71f77d15
authored
May 11, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2895 from jpmens/docreqs
Add Requirements to rst template, ansible-doc
parents
d59d420d
eeb80c69
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
2 deletions
+23
-2
bin/ansible-doc
+6
-0
hacking/templates/rst.j2
+13
-0
library/packaging/apt
+4
-2
No files found.
bin/ansible-doc
View file @
71f77d15
...
...
@@ -86,6 +86,11 @@ def print_man(doc):
subsequent_indent
=
opt_indent
)
if
'requirements'
in
doc
and
len
(
doc
[
'requirements'
])
>
0
:
req
=
", "
.
join
(
doc
[
'requirements'
])
print
"Requirements:
%
s
\n
"
%
textwrap
.
fill
(
tty_ify
(
req
),
initial_indent
=
" "
,
subsequent_indent
=
opt_indent
)
if
'examples'
in
doc
and
len
(
doc
[
'examples'
])
>
0
:
print
"Example
%
s:
\n
"
%
(
''
if
len
(
doc
[
'examples'
])
<
2
else
's'
)
for
ex
in
doc
[
'examples'
]:
...
...
@@ -94,6 +99,7 @@ def print_man(doc):
if
'plainexamples'
in
doc
and
doc
[
'plainexamples'
]
is
not
None
:
print
doc
[
'plainexamples'
]
def
print_snippet
(
doc
):
desc
=
tty_ify
(
""
.
join
(
doc
[
'short_description'
]))
...
...
hacking/templates/rst.j2
View file @
71f77d15
...
...
@@ -42,6 +42,18 @@
</table>
{% endif %}
{% if requirements %}
.. raw:: html
<p>
<b>Requirements:</b>
{% for req in requirements %}
@{ req | html_ify }@
{% endfor %}
</p>
{% endif %}
.. raw:: html
{% for example in examples %}
...
...
@@ -62,6 +74,7 @@
</pre>
{% endif %}
{% if notes %}
.. raw:: html
...
...
library/packaging/apt
View file @
71f77d15
...
...
@@ -82,8 +82,11 @@ options:
required
:
false
default
:
"yes"
choices
:
[
"yes"
,
"safe"
,
"full"
,
"dist"
]
requirements
:
[
python
-
apt
,
aptitude
]
author
:
Matthew
Williams
notes
:
[]
notes
:
-
Two
of
the
upgrade
modes
(
C
(
full
)
and
C
(
dist
))
require
C
(
aptitude
),
otherwise
C
(
apt
-
get
)
suffices
.
examples
:
-
code
:
"apt: pkg=foo update_cache=yes"
description
:
Update
repositories
cache
and
install
C
(
foo
)
package
...
...
@@ -103,7 +106,6 @@ examples:
description
:
Run
the
equivalent
of
C
(
apt
-
get
update
)
as
a
separate
step
-
code
:
"apt: update_cache=yes cache_valid_time=3600"
description
:
Only
run
C
(
update_cache
=
yes
)
if
the
last
one
is
more
than
more
than
3600
seconds
ago
requirements
:
[
python
-
apt
,
aptitude
]
'''
import traceback
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment