پودمان:Ayat-Navigator
توضیحات این پودمان میتواند در پودمان:Ayat-Navigator/توضیحات قرار گیرد.
require('strict')
local p = {}
local args = {}
local num_con = require('Module:Numeral converter').convert
local getArgs = require('Module:Arguments').getArgs
--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
local sure_num = args["sure_num"]
if getData(num_con("en", sure_num)) then
data = data or getData(num_con("en", sure_num))
if data then
local ayat_namdar = data['ayat_namdar']
for k, v in ipairs(ayat_namdar) do
listitems = listitems .. '\n* ' .. #ayat_namdar
end
end
end
return listitems
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
local aye_num = args["aye_num"]
local sure_num = args["sure_num"]
local 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
local sure_num = args["sure_num"]
if getData(num_con("en", sure_num)) then
local data = data or getData(num_con("en", sure_num))
if data then
local mortabet = data['mortabet']
for k, v in ipairs(mortabet) do
listitems = listitems .. '\n* ' .. v
end
end
end
return listitems
end
return p