summaryrefslogtreecommitdiff
path: root/giscanner/doctemplates/devdocs/Gjs/_method.tmpl
blob: 3e4d596e6fc11cff5979b8f7a844fc14c65abbc7 (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
<%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
    % if m.parameters:
      <dt>Parameters:</dt>
      <dd>
        <ul>
          % for p in m.parameters:
            <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 m.retval.type != ast.TYPE_NONE:
      <dt>Returns:</dt>
      <dd>
        (<code>${formatter.format_type(m.retval.type)}</code>)
        % if m.retval.doc:
          ${formatter.format_inline(m, m.retval.doc)}
        % endif
      </dd>
    % endif
  </dl>
</%def>

<%def name="method(m, static=False, virtual=False)">
  <% invocation = ", ".join(map(lambda p: p.argname, m.parameters)) %>
  <h3>
    <span class="entry ${get_node_kind(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)}
</%def>