Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Page
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 callAssert = require('Module:CallAssert') local function main(frame, field) local args, pargs = frame.args, ( frame:getParent() or {} ).args or {} local makeTitle=args.makeTitle or pargs.makeTitle local namespace=args.namespace or pargs.namespace or "" local fragment=args.fragment or pargs.fragment or "" local interwiki=args.interwiki or pargs.interwiki or "" local page=args.page or args[1] or pargs.page or pargs[1] or "" local id= tonumber( args.id or pargs.id ) local pn = {} local title -- holds the result of the mw.title.xxx call for i = 1,9 do pn[i] = args['p'..i] or pargs['p'..i] end if not id and not mw.ustring.match( page, '%S' ) then page = nil end if id then title = callAssert(mw.title.new, 'mw.title.new', id) elseif not page then title = callAssert(mw.title.getCurrentTitle, 'getCurrentTitle') elseif makeTitle then title = callAssert(mw.title.makeTitle, 'makeTitle', namespace, page, fragment, interwiki) else title = callAssert(mw.title.new, 'mw.title.new', page, namespace) end local result = title[field] if type(result) == "function" then result = result(title, unpack(pn)) end return tostring(result or "") end -- handle all errors in main main = require('Module:Protect')(main) local p = {} -- main function does all the work local meta = {} function meta.__index(self, key) return function(frame) return main(frame, key) end end setmetatable(p, meta) function p.getContent(frame) local args, pargs = frame.args, ( frame:getParent() or {} ).args or {} local fmt = args.as or pargs.as or "pre" local text = main(frame, "getContent") fmt = mw.text.split( fmt, ", ?" ) for _, how in ipairs( fmt ) do if how == "pre" then text = table.concat{ "<pre>", text, "</pre>" } elseif how == "expand" then text = frame:preprocess(text) elseif how == "nowiki" then text = mw.text.nowiki(text) end end return text 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)
Templates used on this page:
Template:Module other
(
edit
)
Template:Module rating
(
edit
)
Template:Ombox
(
edit
)
Template:Sandbox other
(
edit
)
Template:Slink
(
edit
)
Template:Used in system
(
edit
)
Module:Arguments
(
edit
)
Module:Effective protection level
(
edit
)
Module:High-use
(
edit
)
Module:Message box
(
edit
)
Module:Message box/configuration
(
edit
)
Module:Message box/ombox.css
(
edit
)
Module:Page/doc
(
edit
)
Module:String
(
edit
)
Module:Transclusion count
(
edit
)
Module:Transclusion count/data/P
(
edit
)
Module:Yesno
(
edit
)