mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
WIP on refactoring the module formatter code that we use to build the doc site with.
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
<!-- @{ module | upper }@ -->
|
||||
|
||||
<h2>@{module}@</h2>
|
||||
|
||||
{% for desc in description -%}
|
||||
@{ desc | convert_symbols_to_format }@
|
||||
{% endfor %}
|
||||
@@ -1,5 +0,0 @@
|
||||
function AnsibleModules($scope) {
|
||||
$scope.modules = @{ json }@;
|
||||
|
||||
$scope.orderProp = "module";
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
{# -------------------------------------------------------------------
|
||||
template for module_formatter.py for LaTeX output (Ansible Booklet)
|
||||
by Jan-Piet Mens.
|
||||
Note: nodes & code examples are omitted on purpose.
|
||||
-------------------------------------------------------------------- #}
|
||||
%--- @{ module | upper }@ ---- from @{ filename }@ ---
|
||||
|
||||
%: -- module header
|
||||
\mods{@{module}@}{@{docuri}@}{
|
||||
{% for desc in description -%}
|
||||
@{ desc | convert_symbols_to_format }@
|
||||
{% endfor -%}
|
||||
{% if version_added is defined -%}
|
||||
(\I{* new in version @{ version_added }@})
|
||||
{% endif -%}
|
||||
}
|
||||
|
||||
%: -- module options
|
||||
|
||||
|
||||
|
||||
{% if options %}
|
||||
\begin{xlist}{abcdefghijklmno}
|
||||
{% for (opt,v) in options.iteritems() %}
|
||||
{% if v['required'] %}
|
||||
\item[\man\,\C{@{ opt }@}]
|
||||
{% else %}
|
||||
\item[\opt\,\C{@{ opt }@}]
|
||||
{% endif %}
|
||||
|
||||
{# -------- option description ----------#}
|
||||
{% for desc in v.description %}
|
||||
@{ desc | convert_symbols_to_format }@
|
||||
{% endfor %}
|
||||
{% if v['choices'] %}
|
||||
\B{Choices}:\,
|
||||
{% for choice in v['choices'] %}\C{@{ choice }@}{% if not loop.last %},{% else %}.{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if v['default'] %}
|
||||
(default \C{@{ v['default'] }@})
|
||||
{% endif %}
|
||||
{% if v['version_added'] is defined %}
|
||||
(\I{* version @{ v['version_added'] }@})
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
\end{xlist}
|
||||
{% endif %}
|
||||
|
||||
{# ---------------------------------------
|
||||
{% if notes %}
|
||||
|
||||
{% for note in notes %}
|
||||
\I{@{ note | convert_symbols_to_format }@}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
----------------------------- #}
|
||||
|
||||
{#-------------------------------------------
|
||||
|
||||
{% if examples is defined -%}
|
||||
{% for e in examples %}
|
||||
\begin{extymeta}
|
||||
@{ e['code'] }@
|
||||
\end{extymeta}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
----------------------------------- #}
|
||||
|
||||
{% if extradata is defined %}
|
||||
%--- BEGIN-EXTRADATA
|
||||
\begin{extymeta}
|
||||
@{ extradata }@
|
||||
\end{extymeta}
|
||||
%----- END-EXTRADATA
|
||||
{% endif %}
|
||||
@@ -1,64 +0,0 @@
|
||||
## @{ module | convert_symbols_to_format }@
|
||||
|
||||
{# ------------------------------------------
|
||||
#
|
||||
# This is Github-flavored Markdown
|
||||
#
|
||||
--------------------------------------------#}
|
||||
|
||||
{% if version_added is defined -%}
|
||||
New in version @{ version_added }@.
|
||||
{% endif %}
|
||||
|
||||
{% for desc in description -%}
|
||||
@{ desc | convert_symbols_to_format }@
|
||||
|
||||
{% endfor %}
|
||||
|
||||
{% if options -%}
|
||||
<table>
|
||||
<tr>
|
||||
<th class="head">parameter</th>
|
||||
<th class="head">required</th>
|
||||
<th class="head">default</th>
|
||||
<th class="head">choices</th>
|
||||
<th class="head">comments</th>
|
||||
</tr>
|
||||
{% for (k,v) in options.iteritems() %}
|
||||
<tr>
|
||||
<td>@{ k }@</td>
|
||||
<td>{% if v.get('required', False) %}yes{% else %}no{% endif %}</td>
|
||||
<td>{% if v['default'] %}@{ v['default'] }@{% endif %}</td>
|
||||
<td><ul>{% for choice in v.get('choices',[]) -%}<li>@{ choice }@</li>{% endfor -%}</ul></td>
|
||||
<td>{% for desc in v.description -%}@{ desc | html_ify }@{% endfor -%}{% if v['version_added'] %} (added in Ansible @{v['version_added']}@){% endif %}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endif %}
|
||||
|
||||
{% if examples or plainexamples %}
|
||||
#### Examples
|
||||
{% endif %}
|
||||
|
||||
{% for example in examples %}
|
||||
{% if example['description'] %}
|
||||
* @{ example['description'] | convert_symbols_to_format }@
|
||||
{% endif %}
|
||||
|
||||
```
|
||||
@{ example['code'] }@
|
||||
```
|
||||
{% endfor %}
|
||||
{% if plainexamples -%}
|
||||
```
|
||||
@{ plainexamples }@
|
||||
```
|
||||
{% endif %}
|
||||
|
||||
{% if notes %}
|
||||
#### Notes
|
||||
{% for note in notes %}
|
||||
@{ note | convert_symbols_to_format }@
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user