aboutsummaryrefslogtreecommitdiff
path: root/tools/ldoc.ltp
blob: 3fa96bb0f1f61919419dbcc9607ead68292468ce (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
# local iter = ldoc.modules.iter
# local M = ldoc.markup

<h1>Module $(module.name)</h1>

<p>$(M(module.summary))</p>

# for kind, items in module.kinds() do

<h2>$(kind)</h2>
  <dl>
#  for item in items() do ldoc.item = item -- provides context for M()
    <dt><span id="$(item.name)"><code>$(ldoc.display_name(item))</code></span></dt>
    <dd>
      <p>$(item.summary)</p>
#  if item.params and #item.params > 0 then
      $(module.kinds:type_of(item).subnames):
      <dl>
#     for p in iter(item.params) do
        <dt><code>$(p)</code>:</dt>
        <dd>$(M(item.params.map[p]))</dd>
#     end -- for
      </dl>
#   end -- if params
#   if item.ret then
    <p>Returns: $(item.ret[1])</p>
#   end -- if returns
#   if item.usage then
    <p>Usage:</p>
    <pre><code>$(item.usage[1])</code></pre>
#   end -- if usage
#   if item.see then
    See also: <a href="#$(item.see[1].label)">$(item.see[1].label)</a>

#   end -- if see
# end -- for items
  </dl>
# end -- for kinds