diff options
Diffstat (limited to 'giscanner/doctemplates/devdocs/Gjs/_method.tmpl')
-rw-r--r-- | giscanner/doctemplates/devdocs/Gjs/_method.tmpl | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/giscanner/doctemplates/devdocs/Gjs/_method.tmpl b/giscanner/doctemplates/devdocs/Gjs/_method.tmpl new file mode 100644 index 00000000..57520465 --- /dev/null +++ b/giscanner/doctemplates/devdocs/Gjs/_method.tmpl @@ -0,0 +1,71 @@ +<%namespace name="doc" file="_doc.tmpl"/> + +<%def name="describe_parameters(m, static=False, virtual=False)"> + <dl> + % if static: + <dt>Type:</dt> + <dd>Static</dd> + % elif virtual: + <dt>Type:</dt> + <dd>Virtual</dd> + % endif + <% + in_params = formatter.get_in_parameters(m) + out_params = formatter.get_out_parameters(m) + %> + % if in_params: + <dt>Parameters:</dt> + <dd> + <ul> + % for p in in_params: + <li> + <strong>${p.argname}</strong> + (<code>${formatter.format_type(p.type)}</code>) + % if p.doc: + — ${formatter.format_inline(m, p.doc)} + % endif + </li> + % endfor + </ul> + </dd> + % endif + % if out_params: + <dt>Returns:</dt> + <dd> + <ul> + % for p in out_params: + <li> + % if len(out_params) > 1: + <strong>${p.argname}</strong> + % endif + (<code>${formatter.format_type(p.type)}</code>) + % if p.doc: + — ${formatter.format_inline(m, p.doc)} + % endif + </li> + % endfor + </ul> + </dd> + % endif + % if m.throws: + <dt>Throws exception:</dt> + <dd>Yes</dd> + % endif + </dl> +</%def> + +<%def name="method(m, static=False, virtual=False)"> + <%doc:introspectable node="${m}"> + <% invocation = ", ".join(map(lambda p: p.argname, m.parameters)) %> + + <h3> + <span class="entry ${get_node_kind(m)} ${doc.deprecated_class(m)}" + id="${formatter.make_anchor(m)}"> + ${formatter.format_function_name(m)}<!-- no space + --></span><!-- no space + -->(${formatter.format_in_parameters(m)}) + </h3> + ${describe_parameters(m, static, virtual)} + ${doc.format_documentation(m)} + </%doc:introspectable> +</%def> |