This repository has been archived by the owner on Aug 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathassertion.j2
119 lines (100 loc) · 3.45 KB
/
assertion.j2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
.. _@{ assertion_name }@:
{% set title = assertion_name %}
{% set title_len = title|length %}
@{ title }@
@{ '-' * title_len }@
{% if short_description %}
@{ short_description|convert_symbols_to_format }@
{% endif %}
{% if description %}
{% for desc in description -%}
* @{ desc | convert_symbols_to_format }@
{% endfor %}
{% endif %}
{% if options -%}
The following parameters may be specified for this assertion:
.. raw:: html
<table border=1 cellpadding=4>
<tr>
<th class="head">parameter</th>
<th class="head">type</th>
<th class="head">required</th>
<th class="head">default</th>
<th class="head">comments</th>
</tr>
{% for k in option_keys -%}
{% set v = options[k] -%}
{% if not v['suboptions'] %}
<tr>
<td>@{ k }@<br/><div style="font-size: small;">{% if v['version_added'] -%} (added in @{v['version_added']}@){% endif -%}</div></td>
<td>{% if v['type'] -%}@{ v['type'] }@{% endif -%}</td>
<td>{% if v.get('required', False) -%}yes{% else %}no{% endif -%}</td>
<td>{% if v.get('default', None) is not none -%}@{ v['default'] | string | html_ify }@{% endif -%}</td>
<td>
{% if v.description is string %}
<div>@{ v.description | replace('\n', '\n ') | html_ify }@</div>
{% else %}
{% for desc in v.description %}
<div>@{ desc | replace('\n', '\n ') | html_ify }@</div>
{% endfor %}
{% endif %}
{% if 'aliases' in v and v.aliases %}
</br><div style="font-size: small;">aliases: @{ v.aliases|join(', ') }@</div>
{% endif %}
{% else %}
<tr>
<td rowspan="2">@{ k }@<br/><div style="font-size: small;">{% if v['version_added'] -%} (added in @{v['version_added']}@){% endif -%}</div></td>
<td>{% if v['type'] -%}@{ v['type'] }@{% endif -%}</td>
<td>{% if v.get('required', False) -%}yes{% else -%}no{% endif -%}</td>
<td></td>
<td></td>
<td>
{% for desc in v.description %}
<div>@{ desc | replace('\n', '\n ') | html_ify }@</div>
{% endfor %}
{% if 'aliases' in v and v.aliases %}
</br><div style="font-size: small;">aliases: @{ v.aliases|join(', ') }@</div>
{% endif %}
</tr>
<tr>
<td colspan="5">
<table border=1 cellpadding=4>
<caption><b>Dictionary object @{ k }@</b></caption>
<tr>
<th class="head">parameter</th>
<th class="head">type</th>
<th class="head">required</th>
<th class="head">default</th>
<th class="head">comments</th>
</tr>
{% for k2 in v['suboptions'] %}
{% set v2 = v['suboptions'] [k2] %}
<tr>
<td>@{ k2 }@<br/><div style="font-size: small;">{% if v2['version_added'] -%} (added in @{v2['version_added']}@){% endif -%}</div></td>
<td>{% if v2['type'] -%}@{ v2['type'] }@{% endif -%}</td>
<td>{% if v2.get('required', False) -%}yes{% else -%}no{% endif -%}</td>
<td>{% if v2.get('default', None) is not none -%}@{ v2['default'] | string | html_ify }@{% endif -%}</td>
<td>
{% if v2.description is string %}
<div>@{ v2.description | replace('\n', '\n ') | html_ify }@</div>
{% else %}
{% for desc in v2.description %}
<div>@{ desc | replace('\n', '\n ') | html_ify }@</div>
{% endfor %}
{% endif %}
{% if 'aliases' in v and v2.aliases %}
</br><div style="font-size: small;">aliases: @{ v2.aliases|join(', ') }@</div>
{% endif %}
</td>
</tr>
{% endfor %}
</table>
</td>
</tr>
{% endif %}
</td>
</tr>
{% endfor %}
</table>
</br>
{% endif %}