Content deleted Content added
No edit summary |
update image display for dark mode per TPER |
||
(8 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 title = nil -- display and search title (default: article name w/out dab)
local dtitle = nil -- display title (default: title)
local stitle = nil -- search title (default: title)
Line 26 ⟶ 25:
title = trimArg(args.title)
if not title then
title = mw.title.getCurrentTitle().text
end
stitle = dtitle
if trimArg(args.stitle) then
stitle = trimArg(args.stitle)
if not trimArg(args.title) then -- For when used outside main article space
dtitle = stitle
end
Line 42 ⟶ 41:
end
▲ local dtitle = mw.ustring.gsub(dtitle,"%s+%([^%(]-%)$", "") -- remove disambiguation ()
local stitle = mw.ustring.gsub(stitle," ", "+") -- replace "<space>" with "+"
Line 56 ⟶ 53:
end
local url = "[[
return url
|