মডিউল:লিব্রিভক্স বই
মডিউল নথি[তৈরি করুন]
আপনি চাইলে এই স্ক্রিবুন্তো মডিউলের জন্য একটি নথির পাতা তৈরি করতে পারেন (তৈরি করুন) সম্পাদনাকারীগণ খেলাঘর (তৈরি করুন | আয়না) এবং পরীক্ষা পাতায় (তৈরি করুন) এই মডিউল সংক্রান্ত পরীক্ষা-নিরীক্ষা করতে পারেন। দয়া করে /নথি উপপাতায় বিষয়শ্রেণী যোগ করুন। এই মডিউলের উপপাতাসমূহ। |
local p = {}
function p.book(frame)
local pframe = frame:getParent()
local args = pframe.args
local tname = "লিব্রিভক্স বই" -- 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)
local lname = nil -- last name
local id = nil -- unsupported argument
local author = nil -- author
local tagline = "[[লিব্রিভক্স|লিব্রিভক্সে]] পাবলিক ডোমেইন অডিওবই (ইংরেজি)"
local urlhead = "https://librivox.org/search?"
local italic = "''"
id = trimArg(args.id)
if id then
error("টেমপ্লেটে ত্রুটি:" .. tname .. " - আইডি আর্গুমেন্ট সমর্থিত নয় - দয়া করে [[টেমপ্লেট:লিব্রিভক্স লেখক]]-এ নথি দেখুন")
end
title = trimArg(args.title)
if not title then
title = mw.title.getCurrentTitle().text
end
dtitle = mw.ustring.gsub(title,'%s+%([^%(]-%)$', '') -- Remove the final disambig paren
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
end
if trimArg(args.dtitle) then
dtitle = trimArg(args.dtitle)
italic = ""
end
local stitle = mw.ustring.gsub(stitle," ", "+") -- replace "<space>" with "+"
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(author, " ")
local l, count = mw.ustring.gsub(author, "%S+", "")
lname = N[count]
end
local url = "[[File:Speaker Icon.svg|15px|link=|alt=]] " .. "[" .. urlhead .. "title=" .. stitle .. "&author=" .. lname .. "&reader=&keywords=&genre_id=0&status=all&project_type=either&recorded_language=&sort_order=catalog_date&search_page=1&search_form=advanced" .. " " .. italic .. dtitle .. italic .. "]" .. " " .. tagline
return url
end
function trimArg(arg)
if arg == "" or arg == nil then
return nil
else
return mw.text.trim(arg)
end
end
return p