> local iter = ldoc.modules.iter > local display_name = ldoc.display_name > local function trim_newline(s) > return (s:gsub("\n", "\r")) > end --- title: APISIX Plugin Development Docs --- ## $(ldoc.title) ### $(module.name) $(module.summary) $(module.description) > > for kind, items in module.kinds() do > for item in items() do #### $(trim_newline(display_name(item))) > if item.type == "function" then > if item.summary and item.summary ~= '' then **Summary**: $(item.summary) > end -- if item.summary > if item.description and item.description ~= '' then **Description**: ```text$(trim_newline(item.description)) ``` > end -- if item.description > end -- if item.type > if item.params and #item.params > 0 then > local subnames = module.kinds:type_of(item).subnames > if subnames then **$(subnames)** > end -- if subnames > -- print the parameters > for par in iter(item.params) do > local param = item:subparam(par) > for p in iter(param) do > local name = item:display_name_of(p) > local tp = item:type_of_param(p) * **$(name)**($(tp)):$(item.params.map[p]) > if tp ~= '' then > end -- if tp > > end -- for p > end -- for par > end -- if item.params and #item.params > 0 > > -- print the returns > 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); * `$(type)`: $(r.text) > end -- for r in group:iter() > end -- for i,group > end -- if item.retgroups > if item.usage then **Usage** > for usage in item.usage:iter() do ```lua $(trim_newline(usage)) ``` > end -- for usage in item.usage:iter() > local usage = item.usage > end -- if item.usage > end -- end for item in items() > end -- for kinds, items