changes in templates required for supporting Sections

This commit is contained in:
steve donovan 2011-06-06 18:35:23 +02:00
parent 3dedea5b49
commit 74455c089a
1 changed files with 185 additions and 170 deletions

355
ldoc.ltp
View File

@ -1,170 +1,185 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html> <html>
<head> <head>
<title>$(ldoc.title)</title> <title>$(ldoc.title)</title>
<link rel="stylesheet" href="$(ldoc.css)" type="text/css" /> <link rel="stylesheet" href="$(ldoc.css)" type="text/css" />
</head> </head>
<body> <body>
<div id="container"> <div id="container">
<div id="product"> <div id="product">
<div id="product_logo"></div> <div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div> <div id="product_name"><big><b></b></big></div>
<div id="product_description"></div> <div id="product_description"></div>
</div> <!-- id="product" --> </div> <!-- id="product" -->
<div id="main"> <div id="main">
# local iter = ldoc.modules.iter # local iter = ldoc.modules.iter
# local M = ldoc.markup # local M = ldoc.markup
<!-- Menu --> <!-- Menu -->
<div id="navigation"> # local function no_spaces(s) return s:gsub('%s','_') end
<h1>$(ldoc.project)</h1>
<ul> <div id="navigation">
<li><a href="../index.html">Index</a></li> <h1>$(ldoc.project)</h1>
</ul> # if not ldoc.single then
<ul>
# for kind, mods, type in ldoc.kinds() do <li><a href="../index.html">Index</a></li>
<h2>$(kind)</h2> </ul>
<ul> # else
# local this_mod = module and module.name <p>$(ldoc.description)</p>
# local base = "" # end
# kind = kind:lower()
# if module then # if module then
# if module.type ~= type.type then base = "../"..kind.."/" end <h2>Contents</h2>
# else base = kind.."/" <ul>
# end # for kind,items in module.kinds() do
# for mod in mods() do <li><a href="#$(no_spaces(kind))">$(kind)</a></li>
# if mod.name == this_mod then # end
<li><strong>$(mod.name)</strong></li> </ul>
# else # end
<li><a href="$(base..mod.name).html">$(mod.name)</a></li>
# end # for kind, mods, type in ldoc.kinds() do
#end <h2>$(kind)</h2>
</ul> <ul>
# end # local this_mod = module and module.name
# local base = ""
</div> # kind = kind:lower()
# if module then
<div id="content"> # if module.type ~= type then base = "../"..kind.."/" end
# else base = kind.."/"
# if module then # end
# for mod in mods() do
<h1>Module <code>$(module.name)</code></h1> # if mod.name == this_mod then
<li><strong>$(mod.name)</strong></li>
# local function use_li(ls) # else
# if #ls > 1 then return '<li>','</li>' else return '','' end <li><a href="$(base..mod.name).html">$(mod.name)</a></li>
# end # end
# local function display_name(item) #end
# if item.type == 'function' then return item.name..'&nbsp;'..item.args </ul>
# else return item.name end # end
# end
</div>
<p>$(M(module.summary))</p>
<p>$(M(module.description))</p> <div id="content">
## -- bang out the tables of item types for this module (e.g Functions, Tables, etc) # if module then
# for kind,items in module.kinds() do
<h2>$(kind)</h2> <h1>Module <code>$(module.name)</code></h1>
<table class="function_list">
# for item in items() do # local function use_li(ls)
<tr> # if #ls > 1 then return '<li>','</li>' else return '','' end
<td class="name" nowrap><a href="#$(item.name)">$(display_name(item))</a></td> # end
<td class="summary">$(M(item.summary))</td> # local function display_name(item)
</tr> # if item.type == 'function' then return item.name..'&nbsp;'..item.args
# end -- for items # else return item.name end
</table> # end
#end -- for kinds
<p>$(M(module.summary))</p>
<br/> <p>$(M(module.description))</p>
<br/>
# -- bang out the tables of item types for this module (e.g Functions, Tables, etc)
# --- currently works for both Functions and Tables. The params field either contains # for kind,items in module.kinds() do
# --- function parameters or table fields. <h2><a href="#$(no_spaces(kind))">$(kind)</a></h2>
# for kind, items, type in module.kinds() do <table class="function_list">
<h2><a name="$(kind)"></a>$(kind)</h2> # for item in items() do
<dl class="function"> <tr>
# for item in items() do <td class="name" nowrap><a href="#$(item.name)">$(display_name(item))</a></td>
<dt> <td class="summary">$(M(item.summary))</td>
<a name = "$(item.name)"></a> </tr>
<strong>$(display_name(item))</strong> # end -- for items
</dt> </table>
<dd> #end -- for kinds
$(M(item.summary))
$(M(item.description)) <br/>
<br/>
# if item.params and #item.params > 0 then
<h3>$(type.subnames):</h3> # --- currently works for both Functions and Tables. The params field either contains
<ul> # --- function parameters or table fields.
# for p in iter(item.params) do # for kind, items in module.kinds() do
<li><code><em>$(p)</em></code>: $(M(item.params[p]))</li> <h2><a name="$(no_spaces(kind))"></a>$(kind)</h2>
# end -- for <dl class="function">
</ul> # for item in items() do
# end -- if params <dt>
<a name = "$(item.name)"></a>
# if item.usage then <strong>$(display_name(item))</strong>
# local li,il = use_li(item.usage) </dt>
<h3>Usage:</h3> <dd>
<ul> $(M(item.summary))
# for usage in iter(item.usage) do $(M(item.description))
$(li)<pre class="example">$(usage)</pre>$(il)
# end -- for # if item.params and #item.params > 0 then
</ul> <h3>$(module.kinds:type_of(item).subnames):</h3>
# end -- if usage <ul>
# for p in iter(item.params) do
# if item.ret then <li><code><em>$(p)</em></code>: $(M(item.params[p]))</li>
# local li,il = use_li(item.ret) # end -- for
<h3>Returns:</h3> </ul>
<ol> # end -- if params
# for r in iter(item.ret) do
$(li)$(M(r))$(il) # if item.usage then
# end -- for # local li,il = use_li(item.usage)
</ol> <h3>Usage:</h3>
# end -- if returns <ul>
# for usage in iter(item.usage) do
# if item.see then $(li)<pre class="example">$(usage)</pre>$(il)
# local li,il = use_li(item.see) # end -- for
<h3>see also:</h3> </ul>
<ul> # end -- if usage
# for see in iter(item.see) do
$(li)<a href="$(see.mod).html#$(see.name)">$(see.label)</a>$(il) # if item.ret then
# end -- for # local li,il = use_li(item.ret)
</ul> <h3>Returns:</h3>
# end -- if see <ol>
</dd> # for r in iter(item.ret) do
# end -- for items $(li)$(M(r))$(il)
</dl> # end -- for
# end -- for kinds </ol>
# end -- if returns
# else -- if module
# if item.see then
# if ldoc.description then # local li,il = use_li(item.see)
<p>$(M(ldoc.description))</p> <h3>see also:</h3>
# end <ul>
# for see in iter(item.see) do
# for kind, mods, type in ldoc.kinds() do $(li)<a href="$(see.mod).html#$(see.name)">$(see.label)</a>$(il)
<h2>$(kind)</h2> # end -- for
# kind = kind:lower() </ul>
# for m in mods() do # end -- if see
<table class="module_list"> </dd>
<tr> # end -- for items
<td class="name"><a href="$(kind)/$(m.name).html">$(m.name)</a></td> </dl>
<td class="summary">$(M(m.summary))</td> # end -- for kinds
</tr>
# end -- for modules # else -- if module
</table>
# end -- for kinds # if ldoc.description then
# end -- if module <p>$(M(ldoc.description))</p>
# end
</div> <!-- id="content" -->
</div> <!-- id="main" --> # for kind, mods in ldoc.kinds() do
<div id="about"> <h2>$(kind)</h2>
</div> <!-- id="about" --> # kind = kind:lower()
</div> <!-- id="container" --> # for m in mods() do
</body> <table class="module_list">
</html> <tr>
<td class="name"><a href="$(no_spaces(kind))/$(m.name).html">$(m.name)</a></td>
<td class="summary">$(M(m.summary))</td>
</tr>
# end -- for modules
</table>
# end -- for kinds
# end -- if module
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>