پودمان:Ayat-Navigator
توضیحات این پودمان میتواند در پودمان:Ayat-Navigator/توضیحات قرار گیرد.
local p = {}
local num_con = require('Module:Numeral converter').convert
--local cfg = mw.loadData('Module:Ayat-Navigator/configs')
local function getData(sure)
local title = mw.title.new('Module:Ayat-Navigator/' .. sure)
if not (title and title.exists) then return nil end
return require('Module:Ayat-Navigator/' .. sure)
end
function p.named_gen(frame)
local listitems = ""
if not getArgs then
getArgs = require('پودمان:Arguments').getArgs
end
if not args then
args = getArgs(frame)
end
sure_num = args["sure_num"]
if getData(num_con("en", sure_num)) then
data = getData(num_con("en", sure_num))
ayat_namdar = data['ayat_namdar']
for k, v in ipairs(ayat_namdar) do
listitems = listitems .. '\n* ' .. v
end
end
end
function p.ayat_gen(frame)
local listitems = ""
if not getArgs then
getArgs = require('پودمان:Arguments').getArgs
end
if not args then
args = getArgs(frame)
end
aye_num = args["aye_num"]
sure_num = args["sure_num"]
sure = args["sure"]
if tonumber(num_con("en", aye_num)) then
for i = 1, tonumber(num_con("en", aye_num)) do
listitems = listitems ..
'\n* [[آیه ' .. num_con("fa", i) .. ' سوره ' .. sure .. '|'
.. num_con("fa", i) .. ']]'
end
end
return listitems
end
function p.mortabet(frame)
local listitems = ""
if not getArgs then
getArgs = require('پودمان:Arguments').getArgs
end
if not args then
args = getArgs(frame)
end
sure_num = args["sure_num"]
if getData(num_con("en", sure_num)) then
data = getData(num_con("en", sure_num))
mortabet = data['mortabet']
for k, v in ipairs(mortabet) do
listitems = listitems .. '\n* ' .. v
end
end
end
return p