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
10009b0d
Commit
10009b0d
authored
Dec 25, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Starting to refactor module formatter script.
Rename "jpfunc" to something more explanatory
parent
c44b876c
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
23 additions
and
23 deletions
+23
-23
docsite/Makefile
+1
-1
docsite/rst/modules.rst
+1
-2
hacking/module_formatter.py
+8
-7
hacking/templates/html.j2
+1
-1
hacking/templates/latex.j2
+3
-3
hacking/templates/man.j2
+4
-4
hacking/templates/markdown.j2
+4
-4
hacking/templates/rst.j2
+1
-1
No files found.
docsite/Makefile
View file @
10009b0d
...
...
@@ -27,6 +27,6 @@ clean:
.PHONEY
:
docs clean
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
docsite/rst/modules.rst
View file @
10009b0d
...
...
@@ -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:
.. include:: modules/_list.rst
.. include:: modules/_categories.rst
.. _ansible_doc:
...
...
hacking/module_formatter.py
View file @
10009b0d
...
...
@@ -264,25 +264,25 @@ def main():
env
.
globals
[
'xline'
]
=
rst_xline
if
options
.
type
==
'latex'
:
env
.
filters
[
'
jpfunc
'
]
=
latex_ify
env
.
filters
[
'
convert_symbols_to_format
'
]
=
latex_ify
template
=
env
.
get_template
(
'latex.j2'
)
outputname
=
"
%
s.tex"
includecmt
=
""
includefmt
=
"
%
s
\n
"
if
options
.
type
==
'html'
:
env
.
filters
[
'
jpfunc
'
]
=
html_ify
env
.
filters
[
'
convert_symbols_to_format
'
]
=
html_ify
template
=
env
.
get_template
(
'html.j2'
)
outputname
=
"
%
s.html"
includecmt
=
""
includefmt
=
""
if
options
.
type
==
'man'
:
env
.
filters
[
'
jpfunc
'
]
=
man_ify
env
.
filters
[
'
convert_symbols_to_format
'
]
=
man_ify
template
=
env
.
get_template
(
'man.j2'
)
outputname
=
"ansible.
%
s.3"
includecmt
=
""
includefmt
=
""
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
[
'fmt'
]
=
rst_fmt
env
.
filters
[
'xline'
]
=
rst_xline
...
...
@@ -291,16 +291,16 @@ def main():
includecmt
=
".. Generated by module_formatter
\n
"
includefmt
=
".. include:: modules/
%
s.rst
\n
"
if
options
.
type
==
'json'
:
env
.
filters
[
'
jpfunc
'
]
=
json_ify
env
.
filters
[
'
convert_symbols_to_format
'
]
=
json_ify
outputname
=
"
%
s.json"
includecmt
=
""
includefmt
=
""
if
options
.
type
==
'js'
:
env
.
filters
[
'
jpfunc
'
]
=
js_ify
env
.
filters
[
'
convert_symbols_to_format
'
]
=
js_ify
template
=
env
.
get_template
(
'js.j2'
)
outputname
=
"
%
s.js"
if
options
.
type
==
'markdown'
:
env
.
filters
[
'
jpfunc
'
]
=
markdown_ify
env
.
filters
[
'
convert_symbols_to_format
'
]
=
markdown_ify
env
.
filters
[
'html_ify'
]
=
html_ify
template
=
env
.
get_template
(
'markdown.j2'
)
outputname
=
"
%
s.md"
...
...
@@ -320,6 +320,7 @@ def main():
category_names
.
sort
()
for
category
in
category_names
:
module_map
=
categories
[
category
]
category
=
category
.
replace
(
"_"
,
" "
)
...
...
hacking/templates/html.j2
View file @
10009b0d
...
...
@@ -3,5 +3,5 @@
<h2>@{module}@</h2>
{% for desc in description -%}
@{ desc |
jpfunc
}@
@{ desc |
convert_symbols_to_format
}@
{% endfor %}
hacking/templates/latex.j2
View file @
10009b0d
...
...
@@ -8,7 +8,7 @@
%: -- module header
\mods{@{module}@}{@{docuri}@}{
{% for desc in description -%}
@{ desc |
jpfunc
}@
@{ desc |
convert_symbols_to_format
}@
{% endfor -%}
{% if version_added is defined -%}
(\I{* new in version @{ version_added }@})
...
...
@@ -30,7 +30,7 @@
{# -------- option description ----------#}
{% for desc in v.description %}
@{ desc |
jpfunc
}@
@{ desc |
convert_symbols_to_format
}@
{% endfor %}
{% if v['choices'] %}
\B{Choices}:\,
...
...
@@ -51,7 +51,7 @@
{% if notes %}
{% for note in notes %}
\I{@{ note |
jpfunc
}@}
\I{@{ note |
convert_symbols_to_format
}@}
{% endfor %}
{% endif %}
----------------------------- #}
...
...
hacking/templates/man.j2
View file @
10009b0d
...
...
@@ -6,7 +6,7 @@
.SH DESCRIPTION
{% for desc in description %}
.PP
@{ desc |
jpfunc
}@
@{ desc |
convert_symbols_to_format
}@
{% endfor %}
.\" ------ OPTIONS
.\"
...
...
@@ -17,7 +17,7 @@
{% set v = options[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') %}
.IR Choices :
...
...
@@ -37,7 +37,7 @@
.SH NOTES
{% for note in notes %}
.PP
@{ note |
jpfunc
}@
@{ note |
convert_symbols_to_format
}@
{% endfor %}
{% endif %}
.\"
...
...
@@ -48,7 +48,7 @@
{% for e in examples %}
.PP
{% if e['description'] %}
@{ e['description'] |
jpfunc
}@
@{ e['description'] |
convert_symbols_to_format
}@
{% endif %}
.nf
...
...
hacking/templates/markdown.j2
View file @
10009b0d
## @{ module |
jpfunc
}@
## @{ module |
convert_symbols_to_format
}@
{# ------------------------------------------
#
...
...
@@ -11,7 +11,7 @@ New in version @{ version_added }@.
{% endif %}
{% for desc in description -%}
@{ desc |
jpfunc
}@
@{ desc |
convert_symbols_to_format
}@
{% endfor %}
...
...
@@ -42,7 +42,7 @@ New in version @{ version_added }@.
{% for example in examples %}
{% if example['description'] %}
* @{ example['description'] |
jpfunc
}@
* @{ example['description'] |
convert_symbols_to_format
}@
{% endif %}
```
...
...
@@ -58,7 +58,7 @@ New in version @{ version_added }@.
{% if notes %}
#### Notes
{% for note in notes %}
@{ note |
jpfunc
}@
@{ note |
convert_symbols_to_format
}@
{% endfor %}
{% endif %}
hacking/templates/rst.j2
View file @
10009b0d
...
...
@@ -15,7 +15,7 @@
{% endif %}
{% for desc in description -%}
@{ desc |
jpfunc
}@
@{ desc |
convert_symbols_to_format
}@
{% endfor %}
{% if options -%}
...
...
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