Home
Random
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:DBR index
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
local p = {} local title = mw.title.getCurrentTitle() -- The point of this module is to keep the [[WP:PEIS]] lower than is possible -- with nested templates. local function sizeof(n) return tonumber(mw.getCurrentFrame():callParserFunction('PAGESIZE', {title.fullText .. '/' .. n, 'R'})) end function p.main(frame) local description = frame.args.description or frame:getParent().args.description or title.subpageText:lower() local as_of = '; data as of ' .. frame:expandTemplate{ title = title.fullText .. '/1', args = {} } .. '.\n' if sizeof(2) > 50 then -- Make a bulleted list of pages local result = {'Index of ' .. description .. as_of .. '<ul><li>[[/1|Page 1]]</li><li>[[/2|Page 2]]</li>'} for i = 3, 50 do if sizeof(i) > 50 then result[#result + 1] = '<li>[[/' .. i .. '|Page ' .. i .. ']]</li>' end end result[#result + 1] = '</ul>' return table.concat(result) end -- There's only one page so extract the table from its content. local content = mw.title.new(title.fullText .. '/1'):getContent():match('{|.*|}') content = frame:getParent():preprocess(content) return mw.getContentLanguage():ucfirst(description) .. as_of .. content end return p
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Module:DBR index/doc
(
edit
)