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
3
3
local string , table = string , table
4
4
local _G , arg = _G , arg
5
5
@@ -21,7 +21,7 @@ local function sorted (tbl)
21
21
end
22
22
table.sort (keys )
23
23
local i = 0
24
- local iter = function (state , ctrl )
24
+ local iter = function (_ , ctrl )
25
25
if i > 0 and ctrl == nil then
26
26
return nil
27
27
else
101
101
local function argslist (parameters )
102
102
local required = List {}
103
103
local optional = List {}
104
- for i , param in ipairs (parameters ) do
104
+ for _ , param in ipairs (parameters ) do
105
105
if param .optional then
106
106
optional :insert (param .name )
107
107
else
@@ -186,7 +186,7 @@ local function render_type (name, level, modulename)
186
186
local propattr = {' type-' .. id .. ' -properties' }
187
187
properties :insert (Header (level + 1 , " Properties" , propattr ))
188
188
for propname , prop in sorted (metatable .docs .properties ) do
189
- attr = {' type-' .. nameprefix .. ' .' .. name .. ' .' .. propname }
189
+ local attr = {' type-' .. nameprefix .. ' .' .. name .. ' .' .. propname }
190
190
properties :insert (Header (level + 2 , propname , attr ))
191
191
properties :insert (
192
192
Plain (read_inlines (prop .description ) ..
@@ -199,6 +199,7 @@ local function render_type (name, level, modulename)
199
199
if next (metatable .methods ) then
200
200
local attr = {' type-' .. id .. ' -methods' }
201
201
methods :insert (Header (level + 1 , " Methods" , attr ))
202
+ -- luacheck: ignore propname
202
203
for propname , method in sorted (metatable .methods ) do
203
204
-- attr = {'type-' .. modulename .. '.' .. name .. '.' .. propname}
204
205
-- methods:insert(Header(level + 2, propname, attr))
@@ -217,15 +218,15 @@ local function render_module (doc)
217
218
local fields = Blocks {}
218
219
if # doc .fields > 0 then
219
220
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
221
222
fields :extend (render_field (fld , 3 , doc .name ))
222
223
end
223
224
end
224
225
225
226
local functions = Blocks {}
226
227
if # doc .functions > 0 then
227
228
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
229
230
functions :extend (render_function (fun , 3 , doc .name ))
230
231
end
231
232
end
@@ -234,7 +235,7 @@ local function render_module (doc)
234
235
local types = type (doc .types ) == ' function' and doc .types () or {}
235
236
if # types > 0 then
236
237
typedocs :insert (Header (2 , ' Types' , {doc .name .. ' -' .. ' types' }))
237
- for i , ty in ipairs (types ) do
238
+ for _ , ty in ipairs (types ) do
238
239
typedocs :extend (render_type (ty , 3 , doc .name ))
239
240
end
240
241
end
@@ -299,13 +300,13 @@ local function foo (input, blocks, start)
299
300
blocks :extend (render_module (documentation (object )))
300
301
return foo (input , blocks , input :find (autogen_end , mstop ) or - 1 )
301
302
else
302
- local reflinks_start , reflinks_stop = input :find (reflinks_marker , start )
303
+ local _ , reflinks_stop = input :find (reflinks_marker , start )
303
304
blocks :insert (rawmd (input :sub (start , reflinks_stop )))
304
305
return blocks
305
306
end
306
307
end
307
308
308
- function _G .Reader (inputs , opts )
309
+ function _G .Reader (inputs , _ )
309
310
local blocks = foo (tostring (inputs ), Blocks {}, 1 )
310
311
blocks = blocks :walk {
311
312
Link = function (link )
0 commit comments