HorseSeaHorse/lib/sock/docstyle/ldoc.ltp

278 lines
7.7 KiB
Plaintext
Raw Normal View History

2021-02-07 00:37:19 -06:00
<!DOCTYPE html>
<html>
<head lang="en">
<title>$(ldoc.title)</title>
<meta charset="utf-8">
<link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/7.0.0/normalize.min.css" rel="styleshet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/milligram/1.3.0/milligram.min.css" rel="stylesheet">
<link rel="stylesheet" href="$(ldoc.css)">
</head>
<body>
# local no_spaces = ldoc.no_spaces
# local use_li = ldoc.use_li
# local display_name = ldoc.display_name
# local iter = ldoc.modules.iter
# local function M(txt,item) return ldoc.markup(txt,item,ldoc.plain) end
# local nowrap = ldoc.wrap and '' or 'nowrap'
# local orig_ldoc_href = ldoc.href
# local function H(see)
# local ref = orig_ldoc_href(see)
# ref = ref:gsub('index.html', '')
# return ref
# end
# ldoc.href = H
<input type="checkbox" id="sidebar_toggle" class="sidebar_toggle" role="button">
<label class="sidebar_toggle_label" for="sidebar_toggle"></label>
<div class="sidebar">
<div class="table-of-contents">
# if not ldoc.no_summary then
# -- bang out the tables of item types for this module (e.g Functions, Tables, etc)
# for kind,items in module.kinds() do
<h2><a href="#$(no_spaces(kind))">$(kind)</a></h2>
<div class="function_list">
# for item in items() do
<div class="name" $(nowrap)><a href="#$(item.name)">$(display_name(item))</a></div>
# end -- for items
</div>
<br>
#end -- for kinds
#end -- if not no_summary
</div>
</div>
<div class="contents">
<!-- Header -->
<header class="header">
<h1 class="project-title">$(ldoc.project)</h1>
</header>
<div id="main">
<!-- Menu -->
<div id="content">
# if ldoc.body then -- verbatim HTML as contents; 'non-code' entries
$(ldoc.body)
# elseif module then -- module documentation
<p>$(M(module.summary,module))</p>
<p>$(M(module.description,module))</p>
# if module.tags.include then
$(M(ldoc.include_file(module.tags.include)))
# end
# if module.usage then
# local li,il = use_li(module.usage)
<h3>Usage:</h3>
<ul>
# for usage in iter(module.usage) do
$(li)<pre class="example">$(ldoc.escape(usage))</pre>$(il)
# end -- for
</ul>
# end -- if usage
# if module.info then
<h3>Info:</h3>
<ul>
# for tag, value in module.info:iter() do
<li><strong>$(tag)</strong>: $(M(value,module))</li>
# end
</ul>
# end -- if module.info
# --- currently works for both Functions and Tables. The params field either contains
# --- function parameters or table fields.
# local show_return = not ldoc.no_return_or_parms
# local show_parms = show_return
# for kind, items in module.kinds() do
# local section_link_name = kind:gsub("Class ", ""):gsub(" ", "")
<section class="section" id="$(section_link_name)">
# local kitem = module.kinds:get_item(kind)
# local has_description = kitem and ldoc.descript(kitem) ~= ""
<h1 class="section-header $(has_description and 'has-description')"><a name="$(no_spaces(kind))"></a>$(kind)</h1>
<div class="section-content">
$(M(module.kinds:get_section_description(kind),nil))
# if kitem then
# if has_description then
<p class="section-description">
$(M(ldoc.descript(kitem),kitem))
</p>
# end
# if kitem.usage then
<h3>Usage:</h3>
<pre class="example">$(ldoc.prettify(kitem.usage[1]))</pre>
# end
# end
<dl class="function">
# for item in items() do
<div class="function_def">
<a class="anchor_link" href="#$(item.name)" name="$(item.name)">🔗</a>
<h3 class="function_name">$(display_name(item))</h3>
# if ldoc.prettify_files then
<a style="float:right;" href="$(ldoc.source_ref(item))">line $(item.lineno)</a>
# end
</dt>
<dd>
<p class="summary">
$(M(item.summary,item))
</p>
<p class="description">
$(M(item.description,item))
</p>
# if ldoc.custom_tags then
# for custom in iter(ldoc.custom_tags) do
# local tag = item.tags[custom[1]]
# if tag and not custom.hidden then
# local li,il = use_li(tag)
<h3>$(custom.title or custom[1]):</h3>
<ul>
# for value in iter(tag) do
$(li)$(custom.format and custom.format(value) or M(value))$(il)
# end -- for
# end -- if tag
</ul>
# end -- iter tags
# end
# if show_parms and item.params and #item.params > 0 then
# local subnames = module.kinds:type_of(item).subnames
# if subnames then
<h3>$(subnames):</h3>
# end
<dl>
# for parm in iter(item.params) do
# local param,sublist = item:subparam(parm)
# if sublist then
<dt><span class="parameter">$(sublist)</dt>$(M(item.params.map[sublist],item))
<dl><dd>
# end
# for p in iter(param) do
# local name,tp,def = item:display_name_of(p), ldoc.typename(item:type_of_param(p)), item:default_of_param(p)
<dt>
<span class="parameter_info">
# if tp ~= '' then
<span class="types">$(tp)</span>
# end
<span class="parameter">$(name)</span>
</span>
</dt>
<dd>
$(M(item.params.map[p],item))
</dt>
# if def == true then
(<em>optional</em>)
# elseif def then
(<em>default</em> $(def))
# end
# if item:readonly(p) then
<em>readonly</em>
# end
</li>
# end
# if sublist then
</dd></dl>
# end
# end -- for
</dl>
# end -- if params
# if show_return and item.retgroups then local groups = item.retgroups
<h3>Returns:</h3>
# for i,group in ldoc.ipairs(groups) do local li,il = use_li(group)
<ol>
# for r in group:iter() do local type, ctypes = item:return_type(r); local rt = ldoc.typename(type)
<li>
# if rt ~= '' then
<span class="types">$(rt)</span>
# end
$(M(r.text,item))$(il)
# if ctypes then
<ul>
# for c in ctypes:iter() do
<li><span class="parameter">$(c.name)</span>
<span class="types">$(ldoc.typename(c.type))</span>
$(M(c.comment,item))</li>
# end
</ul>
# end -- if ctypes
</li>
# end -- for r
</ol>
# if i < #groups then
<h3>Or</h3>
# end
# end -- for group
# end -- if returns
# if show_return and item.raise then
<h3>Raises:</h3>
$(M(item.raise,item))
# end
# if item.see then
# local li,il = use_li(item.see)
<h3>See also:</h3>
<ul class="see-items">
# for see in iter(item.see) do
<li>
<a href="#$(see.name)">$(see.label)</a>$(il)
</li>
# end -- for
</ul>
# end -- if see
# if item.usage then
# local li,il = use_li(item.usage)
<h3>Usage:</h3>
<ul>
# for usage in iter(item.usage) do
$(li)<pre class="example">$(ldoc.prettify(usage))</pre>$(il)
# end -- for
</ul>
# end -- if usage
</dd>
</div>
# end -- for items
</dl>
</div>
</section>
# end -- for kinds
# else -- if module; project-level contents
# if ldoc.description then
<h2>$(M(ldoc.description,nil))</h2>
# end
# if ldoc.full_description then
<p>$(M(ldoc.full_description,nil))</p>
# end
# for kind, mods in ldoc.kinds() do
<h2>$(kind)</h2>
# kind = kind:lower()
<table class="module_list">
# for m in mods() do
<tr>
<td class="name" $(nowrap)><a href="$(no_spaces(kind))/$(m.name).html">$(m.name)</a></td>
<td class="summary">$(M(ldoc.strip_header(m.summary),m))</td>
</tr>
# end -- for modules
</table>
# end -- for kinds
# end -- if module
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>Generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated $(ldoc.updatetime) </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>