summaryrefslogtreecommitdiff
path: root/giscanner/doctemplates/devdocs/Gjs/_method.tmpl
blob: 57520465c08f44e066617c1cd36fd2a7cd9c3eaf (plain)
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
<%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:
                &mdash; ${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:
                &mdash; ${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>