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; '

local function small(str) return ' '..str..' ' end local function bold(str) return ' '..str..' ' end -- Referenced only header local refonly = ..small('Referenced only')..

local function blockIndent(str) return ' '..str..' ' end -- 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..blockIndent(bold(args['title'])) end if args['index'] then output = output..blockIndent(args['index']) end if args['ref'] then output = output..blockIndent(refonly..' '..small(args['ref'])) end -- Change all semicolons to the separator character string output = string.gsub(output, ';', sep) -- Indent the whole thing output = blockIndent(output) return output end

return Index