build: add modified luadoc for use with LuCI sources
[project/luci.git] / build / luadoc / luadoc / doclet / html / function.lp
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.printname%></strong>&nbsp;(<%=table.concat(func.param or {}, ", ")%>)</dt>
12 <dd>
13 <%=func.description or ""%>
14
15 <%if type(func.param) == "table" and #func.param > 0 then%>
16 <h3>Parameters</h3>
17 <ul>
18         <%for p = 1, #func.param do%>
19         <li>
20           <%=func.param[p]%>: <%=func.param[func.param[p]] or ""%>
21         </li>
22         <%end%>
23 </ul>
24 <%end%>
25
26
27 <%if type(func.usage) == "string" then%>
28 <h3>Usage:</h3>
29 <%=func.usage%>
30 <%elseif type(func.usage) == "table" then%>
31 <h3>Usage</h3>
32 <ul>
33         <%for _, usage in ipairs(func.usage) do%>
34         <li><%= usage %>
35         <%end%>
36 </ul>
37 <%end%>
38
39 <%if type(func.ret) == "string" then%>
40 <h3>Return value:</h3>
41 <%=func.ret%>
42 <%elseif type(func.ret) == "table" then%>
43 <h3>Return values:</h3>
44 <ol>
45         <%for _, ret in ipairs(func.ret) do%>
46         <li><%= ret %>
47         <%end%>
48 </ol>
49 <%end%>
50
51 <%if type(func.see) == "string" then %>
52 <h3>See also:</h3>
53         <a href="<%=func.see%>"><%=func.see%></a>
54 <%elseif type(func.see) == "table" and #func.see > 0 then %>
55 <h3>See also:</h3>
56 <ul>
57         <%for i = 1, #func.see do%>
58         <li><a href="<%=luadoc.doclet.html.symbol_link(func.see[i], doc, module_doc, file_doc, from)%>">
59                 <%=(oop and func.see[i]:gsub("%.",":") or func.see[i]:gsub(".+%.",""))%>
60         </a>
61         <%end%>
62 </ul>
63 <%end%>
64 </dd>