UVLDoc: Rendering optimizations and CSS style
authorSteven Barth <steven@midlink.org>
Thu, 11 Sep 2008 15:21:56 +0000 (15:21 +0000)
committerSteven Barth <steven@midlink.org>
Thu, 11 Sep 2008 15:21:56 +0000 (15:21 +0000)
libs/uvldoc/luasrc/uvldoc/proto/xhtml/footer.xml
libs/uvldoc/luasrc/uvldoc/proto/xhtml/header.xml
libs/uvldoc/luasrc/uvldoc/proto/xhtml/index.xml
libs/uvldoc/luasrc/uvldoc/proto/xhtml/menu.xml
libs/uvldoc/luasrc/uvldoc/proto/xhtml/scheme.xml
libs/uvldoc/luasrc/uvldoc/proto/xhtml/section.xml
libs/uvldoc/luasrc/uvldoc/proto/xhtml/uvldoc.css [new file with mode: 0644]
libs/uvldoc/luasrc/uvldoc/renderer.lua

index d353ced18e0e1ea7edabe3bee636855f6a15ea4f..4b974693b97f85297d29b4324e5166e63641f4ef 100644 (file)
@@ -1,9 +1,11 @@
 
-</div>
-
 <div id="copy">
+<hr />
 generated on <%=require "os".date("%c")%> with <a href="http://luci.freifunk-halle.net"><abbr title="Lua Configuration Interface">LuCI</abbr> UVLDoc</a> - written by Steven Barth and Jo-Philipp Wich
 </div>
 
+</div>
+<div class="clear">&nbsp;</div>
+
 </body>
 </html>
\ No newline at end of file
index 9f18ad379064fcb85a1968ff1dc66ef07bc9d572..f4a89b56d66ceaa0fcc5047f66fb6b20fb664ef4 100644 (file)
@@ -4,10 +4,10 @@
 <head>
        <link rel="stylesheet" type="text/css" href="uvldoc.css" />
        <meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
-       <title>LuCI UVLDoc</title>
+       <title><% if title then %><%=title%> - <% end %>LuCI UVLDoc</title>
 </head>
 <body>
-       
+
 <div id="menu">
 <%+menu.xml%>
 </div>
index 269c7989a0399d71666d48dd6e74275c0a8dd50b..a90500481bbe83129e4316e9af3d68ba0bb31985 100644 (file)
@@ -1,10 +1,10 @@
 <%+header.xml%>
 <h1 class="index-title">UCI Documentation</h1>
-<h3 class="index-subtitle">Configurations</h3>
+<h3 class="index-subtitle">Schemes</h3>
 <table class="index">
 <% for k, v in luci.util.kspairs(self.schemes) do %>
 <tr>
-       <td><a href="<%=self:_scheme_filename(k)%>"><%=k%></a></td>
+       <th><a href="<%=self:_scheme_filename(k)%>"><%=k%></a></th>
        <td><%=self.schemes[k].title%></td>
 </tr>
 <% end %>
index bfe8c45ca0bc51d6e62bb27ea5b86b878aefccc3..c0ad3da1b57301a8bdaaa372a2ac903c41345251 100644 (file)
@@ -1,15 +1,19 @@
-<h2 class="menu-title">LuCI UVLDoc</h2>
+<div class="menu-title">LuCI UVLDoc</div>
 <ul class="menu-index">
 <li<%-if not scheme then%> class="menu-active"<%-end-%>>
        <a href="<%=self:_index_filename()%>">Index</a>
 </li>
+</ul>
+
+<div class="menu-title">Schemes</div>
+<ul class="menu-index">
 <% for k, v in luci.util.kspairs(self.schemes) do %>
 <li<%-if scheme == k then%> class="menu-active"<%-end-%>>
        <a href="<%=self:_scheme_filename(k)%>"><%=k%></a>
        <%-if scheme == k then-%>
        <ul>
                <%-for k2, v2 in luci.util.kspairs(v.sections) do%>
-               <li><a href="<%=self:_section_filename(k, k2)%>"><%=k2%></a></li>
+               <li<%-if k2 == section then%> class="menu-active"<%-end-%>><a href="<%=self:_section_filename(k, k2)%>"><%=k2%></a></li>
                <%end-%>
        </ul>
        <%-end%>
index 91043bfc83d1211b645f5ecdbdd38669696bd9a6..f4fe22e75ee90960cd6c474ac8120d03df8bb5f9 100644 (file)
@@ -1,13 +1,14 @@
+<%- title = scheme -%>
 <%+header.xml%>
 <h1 class="section-title"><%=scheme-%>
-<%-if package.title then%>: <%=package.title%><%end%></h1>
+<%-if package.title then%><dfn> - <%=package.title%></dfn><%end%></h1>
 <div class="scheme-description"><%=package.description%></div>
 
 <h3 class="scheme-title">Sections:</h3>
 <table class="scheme-index">
 <% for k, v in luci.util.kspairs(package.sections) do %>
 <tr>
-       <td><a href="<%=self:_section_filename(scheme, k)%>"><%=k%></a></td>
+       <th><a href="<%=self:_section_filename(scheme, k)%>"><%=k%></a></th>
        <td><%=v.title%></td>
 </tr>
 <% end %>
index ed85c25ccea0200c3e7afeee7b0b2e3debf71ff5..92625bc8a560b4f2d1f0c173afd2200fac4c7074 100644 (file)
@@ -1,7 +1,36 @@
+<%- title = scheme .. "." .. type -%> 
 <%+header.xml%>
 <%
 local table = require "table"
 
+types = {
+       list = "List",
+       variable = "Variable",
+       lazylist = "Mixed",
+       enum = "Enumerator",
+       reference = "Reference"
+}
+
+datatypes = {
+       boolean = "Boolean",
+       string = "String",
+       uint = "Unsigned Integer",
+       integer = "Integer",
+       float = "Real Number",
+       ipaddr = "IP-Address",
+       ip4addr = "IPv4-Address",
+       ip6addr = "IPv6-Address",
+       ip4prefix = "IPv4-Prefix",
+       ip6prefix = "IPv6-Prefix",
+       hostname = "Hostname",
+       host = "Host (Hostname or IP-Address)",
+       directory = "Filesystem path (to directory)",
+       file = "Filesystem path (to file)",
+       macaddr = "MAC-Address",
+       port = "Port",
+       portrange = "Single Port or Portrange (First-Last)"
+}
+
 function _parse_ref( r )
        local k, v, h = r:match("([^.]+)%.([^.]+)%.([^.]+)")
        if not k then
@@ -39,10 +68,11 @@ function _parse_dep( r, c, s, o )
 end
 
 %>
+<a name="top" />
 <h1 class="section-title"><%=scheme-%>
-<%-if package.title then%>: <%=package.title%><%end%></h1>
+<%-if package.title then%><dfn> - <%=package.title%></dfn><%end%></h1>
 <h2 class="section-subtitle"><%=type-%>
-<%-if section.title then%>: <%=section.title%><%end%></h2>
+<%-if section.title then%><dfn> - <%=section.title%></dfn><%end%></h2>
 <div class="section-description"><%=section.description%></div>
 
 <h3 class="section-attributes">Attributes:</h3>
@@ -74,7 +104,7 @@ if section.named then %>
                        local t = _parse_dep(k2, scheme, type)
                %>
                        <% if nf then %>and<% end %>
-                       <%if t then%><a href="<%=t%>"><%end%><%=k2%><%if t then%></a><%end%><%if v~="" then%>=<%=v%><%end%>
+                       <%if t then%><a href="<%=t%>"><%end%><%=k2%><%if t then%></a><%end%><%if v~=true then%>=<%=v%><%end%>
                <% nf = true
                        end %>
                </li>
@@ -82,19 +112,19 @@ if section.named then %>
        </ul>
 <% end %>
 
-<h3 class="section-variables">Options:</h3>
+<h3 class="section-variables">Overview:</h3>
 <table class="section-variables-index">
 <% for k, v in luci.util.kspairs(package.variables[type]) do 
 if v.required then%>
 <tr class="section-variable-required">
-       <td><a href="#variable.<%=k%>"><%=k%></a></td>
+       <th><a href="#variable.<%=k%>"><%=k%></a></th>
        <td><%=v.title%></td>
 </tr>
 <% end end
 for k, v in luci.util.kspairs(package.variables[type]) do 
 if not v.required then%>
 <tr class="section-variable-mixed">
-       <td><a href="#variable.<%=k%>"><%=k%></a></td>
+       <th><a href="#variable.<%=k%>"><%=k%></a></th>
        <td><%=v.title%></td>
 </tr>
 <% end end %>
@@ -110,15 +140,19 @@ if (i==0) == v.required then
 <div class="variable-documentation">
        <a name="variable.<%=k%>" />
        <h4 class="variable-title"><%=k-%>
-       <%-if v.title then%>: <%=v.title%><%end%></h4>
+       <%-if v.title then%><dfn> - <%=v.title%></dfn><%end%></h4>
        <div class="variable-description"><%=v.description%></div>
+       <div class="variable-declaration">
        <h5 class="variable-attributes">Attributes:</h5>
        <ul class="varaible-attributes-index">
        <% if v.required then %>
                <li class="variable-attribute-required"><strong>required</strong></li>
        <% end %>
-               <li class="variable-attribute-type"><strong>Type:</strong> <%=v.type%></li>
-               <li class="variable-attribute-datatype"><strong>Datatype:</strong> <%=v.datatype%></li>
+               <li class="variable-attribute-type"><strong>Type:</strong> <%=types[v.type] or v.type%></li>
+               <li class="variable-attribute-datatype"><strong>Datatype:</strong> <%=datatypes[v.datatype] or v.datatype%></li>
+       <% if v.multival then %>
+               <li class="variable-attribute-multiple"><strong>multiple values:</strong> space-separated</li>
+       <% end %>
        </ul>
        <% if v.depends then %>
                <h5 class="variable-depends">Dependencies (one of):</h5>
@@ -130,7 +164,7 @@ if (i==0) == v.required then
                                local t = _parse_dep(k2, scheme, type, k)
                        %>
                                <% if nf then %>and<% end %>
-                               <%if t then%><a href="<%=t%>"><%end%><%=k2%><%if t then%></a><%end%><%if v~="" then%>=<%=v%><%end%>
+                               <%if t then%><a href="<%=t%>"><%end%><%=k2%><%if t then%></a><%end%><%if v~=true then%>=<%=v%><%end%>
                        <% nf = true
                        end %>
                        </li>
@@ -157,6 +191,8 @@ if (i==0) == v.required then
                        <% end %>
                </ul>
        <% end %>
+       </div>
+       <a href="#top">&#8657;</a>
 </div>
 <% end end end -%>
 <%+footer.xml%>
\ No newline at end of file
diff --git a/libs/uvldoc/luasrc/uvldoc/proto/xhtml/uvldoc.css b/libs/uvldoc/luasrc/uvldoc/proto/xhtml/uvldoc.css
new file mode 100644 (file)
index 0000000..2d9d395
--- /dev/null
@@ -0,0 +1,127 @@
+body {
+       font-family: sans-serif;
+       font-size: 0.85em;
+       color: #101010;
+}
+
+h1, h2, h3, h4, h5, h6 {
+       margin-top: 0;
+       font-weight: bold;      
+}
+
+h1 {
+       font-size: 1.5em;
+}
+
+h2 {
+       font-size: 1.4em;       
+}
+
+h3 {
+       font-size: 1.2em;       
+}
+
+h4 {
+       font-size: 1.1em;       
+}
+
+h5 {
+       font-size: 1.0em;       
+}
+
+dfn {
+       font-weight: normal;    
+       font-size: 0.9em;
+}
+
+table {
+       border-collapse: collapse;
+}
+
+tr, td, th {
+       border: 1px solid #e0e0ff;
+       padding: 3px;
+}
+
+th {
+       background-color: #f0f0ff;
+       text-align: left;
+}
+
+
+hr {
+       border: none;
+       background-color: #cccccc;
+       height: 1px;
+}
+
+ul, li {
+       margin-top: 0;
+}
+
+div.clear {
+       clear: both;
+}
+
+div.variable-declaration {
+       padding-left: 2em;      
+}
+
+h3.section-variables {
+       margin-top: 2em;        
+}
+
+div#menu {
+       float: left;
+       background-color: #f0f0ff;
+       margin: 0;
+       padding: 0;
+       border: 1px solid #e0e0ff;
+       width: 11.5em;
+}
+
+#menu ul {
+       list-style-type: none;
+       margin-bottom: 0.5em;
+       padding-left: 1em;
+}
+#menu ul li {
+       margin-left: 0;
+       
+}
+
+div.menu-title {
+       background-color: #e0e0ff;
+       color: #000000;
+       font-weight: bold;
+       padding: 2px;
+}
+
+div#content {
+       margin-top: 0;
+       padding-top: 0;
+       margin-left: 12.5em;
+}
+
+div#copy {
+       margin-top: 2.5em;
+       font-size: 0.7em;
+       text-align: center;
+       font-size: bold;
+}
+
+a:link { 
+       font-weight: bold;
+       color: #004080;
+       text-decoration: none; 
+}
+
+a:visited {
+       font-weight:bold;
+       color: #006699;
+       text-decoration: none;
+}
+
+a:hover {
+       text-decoration:underline;
+}
index 27061d22d8eaba2f38fee008af287d96e8031dd4..d005ba315fa8253f6a18454db323f5a022b09a9f 100644 (file)
@@ -48,7 +48,7 @@ function Generator.make(self)
        fs.mkdir(self.output)
 
        for i, file in ipairs(self.additionals) do
-               fs.copy(self.sourcedir .. file, self.output)
+               fs.copy(self.sourcedir .. file, self.output .. "/" .. file)
        end
 
        template.compiler_mode = "memory"