Debian Codegraph @

flaw/luadoc/doclet/html/function.lp

raw
1 <%
2 if module_doc then
3 from = "modules/"..module_doc.name
4 elseif file_doc then
5 from = "files/.."..file_doc.name
6 else
7 from = ""
8 end
9 %>
10
11 <dt><%=func.private and "local " or ""%><a name="<%=func.name%>"></a><strong><%=func.name%></strong>&nbsp;(<%=table.concat(func.param, ", ")%>)</dt>
12 <dd>
13 <!-- Display description minus the summary line. -->
14 <%=func.description:match("^[ \t]*(.-)[ \t]*$"):match('^[%a%d%s]*%. (.*)$')
15 or '<p>' .. func.description .. '</p>'%>
16
17 <%if type(func.param) == "table" and #func.param > 0 then%>
18 <h3>Parameters</h3>
19 <ul>
20 <%for p = 1, #func.param do%>
21 <li>
22 <%=func.param[p]%>: <%=func.param[func.param[p]] or ""%>
23 </li>
24 <%end%>
25 </ul>
26 <%end%>
27
28
29 <%if type(func.usage) == "string" then%>
30 <h3>Usage:</h3>
31 <%=func.usage%>
32 <%elseif type(func.usage) == "table" then%>
33 <h3>Usage</h3>
34 <ul>
35 <%for _, usage in ipairs(func.usage) do%>
36 <li><%= usage %>
37 <%end%>
38 </ul>
39 <%end%>
40
41 <%if type(func.ret) == "string" then%>
42 <h3>Return value:</h3>
43 <%=func.ret%>
44 <%elseif type(func.ret) == "table" then%>
45 <h3>Return values:</h3>
46 <ol>
47 <%for _, ret in ipairs(func.ret) do%>
48 <li><%= ret %>
49 <%end%>
50 </ol>
51 <%end%>
52
53 <%if type(func.see) == "string" then %>
54 <h3>See also:</h3>
55 <a href="<%=func.see%>"><%=func.see%></a>
56 <%elseif type(func.see) == "table" and #func.see > 0 then %>
57 <h3>See also:</h3>
58 <ul>
59 <%for i = 1, #func.see do%>
60 <li><a href="<%=luadoc.doclet.html.symbol_link(func.see[i], doc, module_doc, file_doc, from)%>">
61 <%=func.see[i]%>
62 </a>
63 <%end%>
64 </ul>
65 <%end%>
66 </dd>