GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||
GeezerVison is showing en.wikipedia.org — Module:Enumerate - Wikipedia
UsageThis module is meant to be invoked inside of a template, since it requires the argument list of the calling template. This module allows the enumeration of a set of parameters with a given prefix. If the prefix was The prefix is defined by the first argument passed into the invocation.
The entries will cut off in the event that the parameters are out of order.
Do note that {{X35}} is sandbox template and does not actually call this module. Parameters
Examples usesSee alsoThe above documentation is transcluded from Module:Enumerate/doc. (edit | history) Editors can experiment in this module's sandbox (create | mirror) and testcases (create) pages. Subpages of this module.
-- Enumerates a given parameter set from the invoking template as a bullet list. local getArgs = require('Module:Arguments').getArgs local yesno = require("Module:Yesno") local p = {} function p.main(frame) local args = getArgs(frame, { frameOnly = true, trim = true }) return p._main(frame, args) end function p._main(frame, args) local prefix = args[1] or args["prefix"] or "" local suffix = args[2] or args["suffix"] or "" local parentArgs = frame:getParent() and getArgs(frame:getParent(), { trim = true }) or args local finalOutput = "" local list = mw.html.create(yesno(args["ordered"]) and "ol" or "ul") local current = 1 local searching = true while searching do local arg = (prefix == "" and suffix == "") and current or prefix .. tostring(current) .. suffix if parentArgs[arg] then list:node( mw.html.create("li") :wikitext((args["pre"] or "") .. parentArgs[arg] .. (args["post"] or "")) ) current = current + 1 else searching = false end end return current == 1 and "" or tostring(list) end return p | ||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |