Module:Index

local Index = {} --- imported libraries -- Parses invocation and template parameters, trims whitespace, and removes blanks. local getArgs = require('Dev:Arguments').getArgs -- Output build string local output = '' -- Separator used between items in the in-line list local sep = ' &bull; '

-- Mimics behavior of ":;" (aka, indenting it by 1.75em and then bolding). Have tried using & instead, which work on normal pages but not here. Possible solution: mw.html:cssText( { text-indent: 1.75em; } ) somewhere? local function firstIndent(str) return ' '..str..' ' end local function bold(str) return ..str.. end -- Mimics behavior of "::" wiki mark-up (aka, indenting it by 3.45em) local function secondIndent(str) return ''..str..'' end local function small(str) return ' '..str..' ' end -- Referenced only header local refonly = ..small('Referenced only').. -- function Index.IndList(frame) -- interprets parameters local args = getArgs(frame) -- calls the internal function that does most of the work -- sends the result back to the template / article return Index._IndList(args) end

function Index._IndList(args) if args['title'] then output = output..firstIndent(bold(args['title'])) end if args['index'] then output = output..secondIndent(args['index']) end if args['ref'] then output = output..secondIndent(refonly..' '..small(args['ref'])) end -- Change all semicolons to the separator character string output = string.gsub(output, ';', sep) return output end

return Index