> local iter = ldoc.modules.iter > local M = ldoc.markup > local use_li = ldoc.use_li > local no_spaces = ldoc.no_spaces > local display_name = ldoc.display_name > local function remove_parent_obj(obj) > obj = obj:gsub(">Concepts%.(.*)<", ">%1<"):gsub(">Common%.(.*)<", ">%1<") > obj = obj:gsub(">{Concepts%.(.*)}<", ">{%1}<"):gsub(">{Common%.(.*)}<", ">{%1}<") > return obj > end > if module then $(module.name) $(module.type) > else $(ldoc.title) > end > if module then > else > end
> if not module then > for kind, mods in ldoc.kinds() do

$(kind)

> kind = kind:lower() > for m in mods() do > if M(ldoc.strip_header(m.summary),m) ~= "" then > end > end -- for modules
$(m.name)$(M(ldoc.strip_header(m.summary),m))
> end -- for kinds > end > if module then

$(module.name) $(module.type)

$(M(module.summary))

$(M(module.description))

> if ldoc.body and module.type == "example" then
$(ldoc.body:gsub("^

(.*%.lua)

(.*)$", "%2"):gsub("
(.*)
", "%1"):gsub("^%s*(.-)%s*$", "%1"))
> elseif ldoc.body and module.type == "topic" then $(M(ldoc.body)) > end > if module.info then
    > for tag, value in module.info:iter() do
  • $(tag): $(M(value,module))
  • > end
> end > if module.see then

See also

> end > if module.usage then

Usage

> for usage in iter(module.usage) do
$(ldoc.prettify(usage))
> end > end > if module and module.type ~= "topic" then > for kind, items in module.kinds() do

$(kind)

$(M(module.kinds:get_section_description(kind))) > for item in items() do > if item.summary ~= "" then > end > end
$(display_name(item))$(M(item.summary,item))
> end > end
> if module and module.type ~= "topic" then > for kind, items in module.kinds() do

$(kind)

> for item in items() do
# $(display_name(item))
> if item.summary ~= "" or item.description ~= "" then

$(M(item.summary))

$(M(item.description))

> end > if not ldoc.no_return_or_parms and item.params and #item.params > 0 then > local module_item_subnames = module.kinds:type_of(item).subnames > if module_item_subnames then $(module_item_subnames): > end
    > for param in iter(item.params) do > local param, sublist = item:subparam(param) > if sublist then
  • $(sublist) : $(M(item.params.map[sublist], item))
      > 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) > if not module_item_subnames then
    • > else
    • > end $(name) > if tp ~= "" or item.params.map[p] ~= "" then : > end > if tp ~= "" then ($(remove_parent_obj(tp))) > end $(remove_parent_obj(M(item.params.map[p], item))) > if def == true then (optional) > elseif def then (default: $(def)) > end > if item:readonly(p) then (readonly) > end
    • > end > if sublist then
  • > end > end
> end > if item.retgroups then > local groups = item.retgroups Returns: > for i, group in ldoc.ipairs(groups) do
    > for r in group:iter() do > local type, ctypes = item:return_type(r) > local rt = ldoc.typename(type)
  • > if rt ~= '' then ($(remove_parent_obj(rt))) > end > if r.text ~= '' then $(remove_parent_obj(M(r.text, item))) > end > if ctypes then
      > for c in ctypes:iter() do
    • $(c.name) ($(ldoc.typename(c.type))) : $(M(c.comment, item))
    • > end
    > end
  • > end
> if i < #groups then
Or
> end > end > end > if item.raise then
Raises
$(M(item.raise, item)) > end > if item.see then See also: > end > if item.usage then Usage: > for usage in iter(item.usage) do
$(ldoc.prettify(usage))
> end > end
> end
> end > else
> end > end