Skip to content

Commit d3527df

Browse files
committed
Merge variables and constants for Lua API
1 parent 2509b68 commit d3527df

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

_includes/api_lua.html

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
{%- assign ref = include.ref -%}
22
{%- assign functions = ref.elements | where: "type", "FUNCTION" -%}
3-
{%- assign variables = ref.elements | where: "type", "VARIABLE" -%}
43
{%- assign messages = ref.elements | where: "type", "MESSAGE" -%}
54
{%- assign properties = ref.elements | where: "type", "PROPERTY" -%}
65
{%- assign macros = ref.elements | where: "type", "MACRO" -%}
76
{%- assign enums = ref.elements | where: "type", "ENUM" -%}
87

8+
{%- assign v = ref.elements | where: "type", "VARIABLE" -%}
9+
{%- assign c = ref.elements | where: "type", "CONSTANT" -%}
10+
{%- assign constants = v | concat: c -%}
11+
912
<h1>{{ ref.info.brief }}</h1>
1013
<p>{{ ref.info.description }}</p>
1114
<p>Version: {{ page.branch }}</p>
@@ -25,16 +28,16 @@ <h1>{{ ref.info.brief }}</h1>
2528
</table>
2629
{%- endif -%}
2730

28-
{%- if variables.size > 0 -%}
31+
{%- if constants.size > 0 -%}
2932
<table class="compact">
3033
<tr>
3134
<th>CONSTANTS</th>
3235
<th></th>
3336
</tr>
34-
{%- for variable in variables -%}
37+
{%- for constant in constants -%}
3538
<tr>
36-
<td><a href="#{% include ref_anchorlink.html element=variable %}">{{ variable.name }}</a></td>
37-
<td>{{ variable.brief }}</td>
39+
<td><a href="#{% include ref_anchorlink.html element=constant %}">{{ constant.name }}</a></td>
40+
<td>{{ constant.brief }}</td>
3841
</tr>
3942
{%- endfor -%}
4043
</table>
@@ -139,15 +142,15 @@ <h4>{{ function.name }}()<a href="#{% include ref_anchorlink.html element=functi
139142
{%- endfor -%}
140143
{%- endif -%}
141144

142-
{%- if variables.size > 0 -%}
145+
{%- if constants.size > 0 -%}
143146
<h2>Constants</h2>
144-
{%- for variable in variables -%}
145-
{% include ref_anchor_target.html element=variable %}
146-
<h5 class="compact">{{ variable.name }}<a href="#{% include ref_anchorlink.html element=variable %}" class="anchor-link"/></a></h5 class="compact">
147-
<p class="compact">{{ variable.description }}</p>
147+
{%- for constant in constants -%}
148+
{% include ref_anchor_target.html element=constant %}
149+
<h5 class="compact">{{ constant.name }}<a href="#{% include ref_anchorlink.html element=constant %}" class="anchor-link"/></a></h5 class="compact">
150+
<p class="compact">{{ constant.description }}</p>
148151

149-
{%- if variable.parameters.size > 0 -%}
150-
{% include api_lua_parameters.html parameters=variable.parameters %}
152+
{%- if constant.parameters.size > 0 -%}
153+
{% include api_lua_parameters.html parameters=constant.parameters %}
151154
{%- endif -%}
152155

153156
{% if forloop.last == false %}<hr class="compact"/>{% else %}<hr/>{% endif %}

0 commit comments

Comments
 (0)