Merge pull request #304 from nmav/ocserv-crypt
[project/luci.git] / build / luadoc / luadoc / doclet / html / module.lp
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html>
4 <head>
5     <title>Reference</title>
6     <link rel="stylesheet" href="<%=luadoc.doclet.html.link('luadoc.css', 'modules/'..module_doc.name)%>" type="text/css" />
7         <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/-->
8 </head>
9
10 <body>
11 <div id="container">
12
13 <div id="product">
14         <div id="product_logo"></div>
15         <div id="product_name"><big><b></b></big></div>
16         <div id="product_description"></div>
17 </div> <!-- id="product" -->
18
19 <div id="main">
20
21 <div id="navigation">
22 <%=luadoc.doclet.html.include("menu.lp", { doc=doc, module_doc=module_doc })%>
23 <% oop = not not ( module_doc.doc[1] and module_doc.doc[1].cstyle == "instance" ) %>
24
25 </div><!-- id="navigation" -->
26
27 <div id="content">
28
29 <h1><%=( oop and "Object Instance" or "Class" )%> <code><%=module_doc.name%></code></h1>
30
31 <p><%=module_doc.description%></p>
32 <%if module_doc.author then%>
33 <p><b><%= #module_doc.author>1 and "Authors" or "Author" %>:</b>
34 <table class="authors_list">
35 <%for _, author in ipairs(module_doc.author) do%>
36         <tr><td class="name"><%= author %></td></tr>
37 <%end%>
38 </table>
39 </p>
40 <%end%>
41 <%if module_doc.copyright then%>
42 <p>Copyright&copy; <%=module_doc.copyright%></p>
43 <%end%>
44 <%if module_doc.release then%>
45 <p><small><b>Release:</b> <%=module_doc.release%></small></p>
46 <%end%>
47
48 <%if #module_doc.constants > 0 then %>
49 <h2>Constants</h2>
50 <table class="function_list">
51 <%for _, const_name in ipairs(module_doc.constants) do
52   local const_data = module_doc.constants[const_name]%>
53         <tr>
54         <td class="name" nowrap><code><%=const_data.private and "local " or ""%><%=(const_name:gsub(".+%.",""))%></code></td>
55         <td class="summary"><%=const_data.summary%></td>
56         </tr>
57 <%end%>
58 </table>
59 <%end%>
60
61 <% local funcs = { }; if #module_doc.functions > 0 then %>
62 <h2>Functions</h2>
63 <table class="function_list">
64 <%
65 for _, func_name in ipairs(module_doc.functions) do
66   funcs[#funcs+1] = func_name
67 end
68
69 table.sort(funcs, function(a, b)
70   local func_data_a = module_doc.functions[a]
71   local func_data_b = module_doc.functions[b]
72   local x = func_data_a.sort or a
73   local y = func_data_b.sort or b
74   return x < y
75 end)
76
77 for _, func_name in ipairs(funcs) do
78   local func_data = module_doc.functions[func_name]
79
80   func_data.printname = func_name:gsub("^%d+#", "")
81   if oop then
82         func_data.printname = func_data.printname:gsub("%.", ":")
83   else
84     func_data.printname = func_data.printname:gsub("^.+%.", "")
85   end
86 %>
87         <tr>
88         <td class="name" nowrap><%=func_data.private and "local " or ""%><a href="#<%=func_name%>"><%=func_data.printname%></a>&nbsp;(<%=table.concat(module_doc.functions[func_name].param or {}, ", ")%>)</td>
89         <td class="summary"><%=module_doc.functions[func_name].summary%></td>
90         </tr>
91 <%end%>
92 </table>
93 <%end%>
94
95
96 <% local tabs = { }; if #module_doc.tables > 0 then%>
97 <h2>Tables</h2>
98 <table class="table_list">
99 <%
100 for _, tab_name in ipairs(module_doc.tables) do
101   tabs[#tabs+1] = tab_name
102 end
103
104 table.sort(tabs, function(a, b)
105   local tab_data_a = module_doc.tables[a]
106   local tab_data_b = module_doc.tables[b]
107   local x = tab_data_a.sort or a
108   local y = tab_data_b.sort or b
109   return x < y
110 end)
111
112 for _, tab_name in ipairs(tabs) do
113 %>
114         <tr>
115         <td class="name" nowrap><a href="#<%=tab_name%>"><%=tab_name%></a></td>
116         <td class="summary"><%=module_doc.tables[tab_name].summary%></td>
117         </tr>
118 <%end%>
119 </table>
120 <%end%>
121
122
123 <br/>
124 <br/>
125
126 <%if #module_doc.functions > 0 then%>
127 <h2><a name="functions"></a>Functions</h2>
128 <dl class="function">
129 <%for _, func_name in ipairs(funcs) do%>
130 <%=luadoc.doclet.html.include("function.lp", { doc=doc, module_doc=module_doc, func=module_doc.functions[func_name], oop=oop })%>
131 <%end%>
132 </dl>
133 <%end%>
134
135 <%if #module_doc.tables > 0 then%>
136 <h2><a name="tables"></a>Tables</h2>
137 <dl class="table">
138 <%for _, tab_name in ipairs(tabs) do%>
139 <%=luadoc.doclet.html.include("table.lp", { doc=doc, module_doc=module_doc, tab=module_doc.tables[tab_name] })%>
140 <%end%>
141 </dl>
142 <%end%>
143
144
145 </div> <!-- id="content" -->
146
147 </div> <!-- id="main" -->
148
149 <div id="about">
150         <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
151 </div> <!-- id="about" -->
152
153 </div> <!-- id="container" -->
154 </body>
155 </html>