* luci/contrib: added support for constants documentation in luadoc
[project/luci.git] / contrib / luadoc / lua / 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 = ( module_doc.doc[1].cstyle == "instance" ) and true or false %>
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 <%if #module_doc.functions > 0 then %>
62 <h2>Functions</h2>
63 <table class="function_list">
64 <%for _, func_name in ipairs(module_doc.functions) do
65   local func_data = module_doc.functions[func_name]%>
66         <tr>
67         <td class="name" nowrap><%=func_data.private and "local " or ""%><a href="#<%=func_name%>"><%=(oop and func_name:gsub("%.",":") or func_name:gsub(".+%.",""))%></a>&nbsp;(<%=table.concat(module_doc.functions[func_name].param, ", ")%>)</td>
68         <td class="summary"><%=module_doc.functions[func_name].summary%></td>
69         </tr>
70 <%end%>
71 </table>
72 <%end%>
73
74
75 <%if #module_doc.tables > 0 then%>
76 <h2>Tables</h2>
77 <table class="table_list">
78 <%for _, tab_name in ipairs(module_doc.tables) do%>
79         <tr>
80         <td class="name" nowrap><a href="#<%=tab_name%>"><%=tab_name%></a></td>
81         <td class="summary"><%=module_doc.tables[tab_name].summary%></td>
82         </tr>
83 <%end%>
84 </table>
85 <%end%>
86
87
88 <br/>
89 <br/>
90
91 <%if #module_doc.functions > 0 then%>
92 <h2><a name="functions"></a>Functions</h2>
93 <dl class="function">
94 <%for _, func_name in ipairs(module_doc.functions) do%>
95 <%=luadoc.doclet.html.include("function.lp", { doc=doc, module_doc=module_doc, func=module_doc.functions[func_name], oop=oop })%>
96 <%end%>
97 </dl>
98 <%end%>
99
100 <%if #module_doc.tables > 0 then%>
101 <h2><a name="tables"></a>Tables</h2>
102 <dl class="table">
103 <%for _, tab_name in ipairs(module_doc.tables) do%>
104 <%=luadoc.doclet.html.include("table.lp", { doc=doc, module_doc=module_doc, tab=module_doc.tables[tab_name] })%>
105 <%end%>
106 </dl>
107 <%end%>
108
109
110 </div> <!-- id="content" -->
111
112 </div> <!-- id="main" -->
113
114 <div id="about">
115         <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>
116 </div> <!-- id="about" -->
117
118 </div> <!-- id="container" -->
119 </body>
120 </html>