Improve support for variable args in documentation.

Now prototypes are automatically generated with/without default arguments,
to better illustrate that they are optional.
This commit is contained in:
Patman64
2014-12-21 20:42:23 -05:00
parent c936555fbd
commit ce53dfb25b
2 changed files with 44 additions and 10 deletions

View File

@@ -53,7 +53,7 @@
{%- if current_method.parameters|length > 0 %}
{%- for param in current_method.parameters %}
<dl>
<dt><code>{{ param.data_type|escape|parse_data_type }} {{ param.name }} {{- ' (' + param.default_value + ')' if param.default_value }}</code></dt>
<dt><code>{{ param.data_type|escape|parse_data_type }} {{ param.name if param.data_type != '...' }} {{- ' (' + param.default_value + ')' if param.default_value }}</code></dt>
<dd class="docblock">{{ param.description|parse_links if param.description else '<em>See method description.</em>' }}</dd>
</dl>
{%- endfor %}