Content deleted Content added
No edit summary |
update image display for dark mode per TPER |
||
(38 intermediate revisions by 5 users not shown) | |||
Line 1:
local p = {}
function p.book(frame)
local pframe = frame:getParent()
Line 9 ⟶ 8:
local tname = "Librivox book" -- name of calling template. Change if template rename.
local
local
local stitle = nil -- search title (default: title)
local lname = nil -- last name
local id = nil -- unsupported argument
local author = nil -- author
local tagline = "public ___domain audiobook at [[LibriVox]]"
local urlhead = "https://librivox.org/search?"
local italic = "''"
id = trimArg(args.id)
if id then
error("Error in Template:" .. tname .. " - id argument not supported - please see documentation at [[Template:Librivox author]]")
end
if not title then
title = mw.title.getCurrentTitle().text
dtitle = title▼
stitle = dtitle▼
else▼
title = mw.text.trim(args.title)▼
end
dtitle = mw.ustring.gsub(
if trimArg(args.stitle
stitle =
if not trimArg(args.title) then -- For when used outside main article space
end
end
if trimArg(args.dtitle
dtitle =
end
▲ dtitle = mw.ustring.gsub(dtitle,"%s%(.*%)", "") -- remove disambiguation ()
stitle = mw.ustring.gsub(stitle,"%s%(.*%)", "")▼
if args.name == "" or args.name == nil then▼
▲ name = ""
author = trimArg(args.author)
if not author then
lname = ""
else
--- Split name into words, count words, set name to last word
local N = mw.text.split(
local l, count = mw.ustring.gsub(
end
local url = "[[File:Speaker Icon.svg|15px|class=skin-invert-image|link=|alt=]] " .. "[" .. urlhead .. "title=" .. stitle .. "&author=" ..
return url
end
function trimArg(arg)
return nil
▲ else
end
end
|