Editing
Module:Cite message
Jump to navigation
Jump to search
β οΈ
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 instead of your IP, along with other benefits.
Anti-spam check. Do
not
fill this in!
-- Implements {{Cite message}} -- {{cite message|author=|date=|content=|server=|channel=|link=}} -- Author (Date): "Content". ''Server'' #Channel. [Link] local getArgs = require("Module:Arguments").getArgs local p = {} -- Surrounds middle with left on the left and right on the right, unless middle is nil, in which case it returns nil. local function surround(middle, left, right) if middle then return left .. middle .. right else return nil end end -- If neither left or right are nil, then returns left concatenated with right with sep as a separator. If only one of left and right is nil, the other is returned. If both are nil, nil is returned. local function combine2(left, right, sep) if left and right then return left .. sep .. right elseif left then return left elseif right then return right else return nil end end function p.main(frame) local args = getArgs(frame) return p._main(args) end function p._main(args) local ftable = {} local authordate = combine2(args.author, surround(args.date, '(', ')'), " ") local authordatecontent = combine2(authordate, surround(args.content, '"', '"'), ": ") table.insert(ftable, authordatecontent) local channel = args.channel if channel then local channelmatch = mw.ustring.match(channel, "^(#?)[^%sA-Z]+$") if channelmatch then if channelmatch[1] ~= "#" then channel = "#" .. channel end end end local serverchannel = combine2(surround(args.server, "''", "''"), channel, " ") table.insert(ftable, serverchannel) local link = surround(args.link, "[", " Link]") table.insert(ftable, link) return table.concat(ftable, ". ") end return p
Summary:
Please note that all contributions to Irony Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see
Irony Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, 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.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Module:Cite message/doc
(
edit
)
Navigation menu
Personal tools
English
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Module
Discussion
English
Views
Read
Edit source
View history
More
Purge cache
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information
Page values