Content deleted Content added
mNo edit summary |
No edit summary |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 12:
end
function CreateLink(url, title)
return "[" .. url .. " " .. title .. "]"
end
function p.main(frame)
Line 31 ⟶ 34:
local archived = parent_args["archived"]
local isbn = parent_args["isbn"]
local journal = parent_args["journal"]
local page = parent_args["page"]
-- Link platform-specific handles and get name.
local handle_link = ""
local platform_name = ""
if ContainsOr(platform, {"Twitter", "X", "twitter", "x"}) then
handle_link = "[https://twitter.com/@" .. handle .. " @" .. handle .. "]"
platform_name = "Twitter / X"
elseif ContainsOr(platform, {"YouTube", "youtube", "YT", "yt", "Youtube"}) then
handle_link = CreateLink("
platform_name = "YouTube"
elseif ContainsOr(platform, {"JoJo News", "jojonews", "jojo news", "JOJO News", "JoJo-News", "jojo-news"}) then
handle_link = CreateLink("https://jojo-news.com/author/" .. handle, handle)
platform_name = "JoJo-News"
end
if parent_args[1] then
final_content = parent_args[1]
elseif title then
else▼
if author then
final_content = final_content .. author
Line 48 ⟶ 59:
final_content = final_content .. " <nowiki>[</nowiki>" .. handle_link .. "]"
end
if date then
final_content = final_content .. " (" .. date .. ")"
end
-- Add comma after author/date if there's a title
final_content = final_content .. ", "
end
if url then
final_content = final_content .. "''\"" .. CreateLink(url, title) .. "\"''"
if archived == true then
final_content = final_content .. " (Archived)"
end
final_content = final_content .. "''\"" .. title .. "\"''"
end
if journal then
final_content = final_content .. ", " .. journal
end
if page then
final_content = final_content .. ", p. " .. page
end
if publisher then
final_content = final_content .. ", " .. publisher
elseif platform then
final_content = final_content .. ", on " .. platform_name
end
if (not author) and date then
final_content = final_content .. ", " .. date
end
final_content = final_content .. "."
if isbn then
final_content = final_content .. " ISBN: " .. frame:expandTemplate{ title = "ISBN", args = { isbn }}
end
end
|