1- local ipairs , load , next , pairs , print , tostring , type , warn =
2- ipairs , load , next , pairs , print , tostring , type , warn
1+ local ipairs , next , pairs , print , tostring , type , warn =
2+ ipairs , next , pairs , print , tostring , type , warn
33local string , table = string , table
44local _G , arg = _G , arg
55
@@ -21,7 +21,7 @@ local function sorted (tbl)
2121 end
2222 table.sort (keys )
2323 local i = 0
24- local iter = function (state , ctrl )
24+ local iter = function (_ , ctrl )
2525 if i > 0 and ctrl == nil then
2626 return nil
2727 else
101101local function argslist (parameters )
102102 local required = List {}
103103 local optional = List {}
104- for i , param in ipairs (parameters ) do
104+ for _ , param in ipairs (parameters ) do
105105 if param .optional then
106106 optional :insert (param .name )
107107 else
@@ -186,7 +186,7 @@ local function render_type (name, level, modulename)
186186 local propattr = {' type-' .. id .. ' -properties' }
187187 properties :insert (Header (level + 1 , " Properties" , propattr ))
188188 for propname , prop in sorted (metatable .docs .properties ) do
189- attr = {' type-' .. nameprefix .. ' .' .. name .. ' .' .. propname }
189+ local attr = {' type-' .. nameprefix .. ' .' .. name .. ' .' .. propname }
190190 properties :insert (Header (level + 2 , propname , attr ))
191191 properties :insert (
192192 Plain (read_inlines (prop .description ) ..
@@ -199,6 +199,7 @@ local function render_type (name, level, modulename)
199199 if next (metatable .methods ) then
200200 local attr = {' type-' .. id .. ' -methods' }
201201 methods :insert (Header (level + 1 , " Methods" , attr ))
202+ -- luacheck: ignore propname
202203 for propname , method in sorted (metatable .methods ) do
203204 -- attr = {'type-' .. modulename .. '.' .. name .. '.' .. propname}
204205 -- methods:insert(Header(level + 2, propname, attr))
@@ -217,15 +218,15 @@ local function render_module (doc)
217218 local fields = Blocks {}
218219 if # doc .fields > 0 then
219220 fields :insert (Header (2 , ' Fields' , {doc .name .. ' -' .. ' fields' }))
220- for i , fld in ipairs (doc .fields ) do
221+ for _ , fld in ipairs (doc .fields ) do
221222 fields :extend (render_field (fld , 3 , doc .name ))
222223 end
223224 end
224225
225226 local functions = Blocks {}
226227 if # doc .functions > 0 then
227228 functions :insert (Header (2 , ' Functions' , {doc .name .. ' -' .. ' functions' }))
228- for i , fun in ipairs (doc .functions ) do
229+ for _ , fun in ipairs (doc .functions ) do
229230 functions :extend (render_function (fun , 3 , doc .name ))
230231 end
231232 end
@@ -234,7 +235,7 @@ local function render_module (doc)
234235 local types = type (doc .types ) == ' function' and doc .types () or {}
235236 if # types > 0 then
236237 typedocs :insert (Header (2 , ' Types' , {doc .name .. ' -' .. ' types' }))
237- for i , ty in ipairs (types ) do
238+ for _ , ty in ipairs (types ) do
238239 typedocs :extend (render_type (ty , 3 , doc .name ))
239240 end
240241 end
@@ -299,13 +300,13 @@ local function foo (input, blocks, start)
299300 blocks :extend (render_module (documentation (object )))
300301 return foo (input , blocks , input :find (autogen_end , mstop ) or - 1 )
301302 else
302- local reflinks_start , reflinks_stop = input :find (reflinks_marker , start )
303+ local _ , reflinks_stop = input :find (reflinks_marker , start )
303304 blocks :insert (rawmd (input :sub (start , reflinks_stop )))
304305 return blocks
305306 end
306307end
307308
308- function _G .Reader (inputs , opts )
309+ function _G .Reader (inputs , _ )
309310 local blocks = foo (tostring (inputs ), Blocks {}, 1 )
310311 blocks = blocks :walk {
311312 Link = function (link )
0 commit comments