Module:Gutenberg: Difference between revisions

Content deleted Content added
updates requested by User:Green Cardamom
fixes and updates
Line 16:
local urlhead = nil
 
-- Argument |id=
id = trimArg(args[1]) or trimArg(args.id)
if not id then
Line 24 ⟶ 25:
else
urlhead = urlheadname
id = mw.ustring.gsub(id," ", "+")
end
end
 
-- Argument |name=
name = trimArg(args[2]) or trimArg(args.name)
if not name then
Line 32 ⟶ 35:
end
 
-- Argument |coda=
local stitle = mw.ustring.gsub(name," ", "+") -- replace "<space>" with "+"
if trimArg(args.coda) then
tagline = tagline .. " " .. trimArg(args.coda)
end
 
url = "[" .. urlhead .. id .. " Works by " .. name .. "] " .. tagline
Line 57 ⟶ 63:
local italic = "''"
 
-- Argument |id=
id = trimArg(args[1]) or trimArg(args.id)
if not id then
Line 62 ⟶ 69:
end
 
-- Argument |name=
name = trimArg(args[2]) or trimArg(args.name)
if not name then
Line 67 ⟶ 75:
end
 
-- Argument |author=
author = trimArg(args.author)
if author then
if mw.ustring.lower(author) == "yes" then
prefix = "Works by "
italic prefix = "Works by "
italic = ""
end
end
 
-- Argument |coda=
if trimArg(args.coda) then
tagline = tagline .. " " .. trimArg(args.coda)
end
 
url = prefix .. "[" .. urlhead .. id .. " " .. prefix .. italic .. name .. italic .. "] " .. tagline
 
return url