پودمان:Ayat-Navigator: تفاوت میان نسخهها
پرش به ناوبری
پرش به جستجو
(getData) |
(named_gen + mortabet) |
||
خط ۷: | خط ۷: | ||
if not (title and title.exists) then return nil end | if not (title and title.exists) then return nil end | ||
return require('Module:Ayat-Navigator/' .. sure) | return require('Module:Ayat-Navigator/' .. sure) | ||
end | |||
function p.named_gen(frame) | |||
local listitems = "" | |||
if not getArgs then | |||
getArgs = require('پودمان:Arguments').getArgs | |||
end | |||
args = getArgs(frame) | |||
sure_num = args["sure_num"] | |||
if getData(num_con("fa", sure_num)) then | |||
data = data or getData(num_con("fa", sure_num)) | |||
ayat_namdar = data['ayat_namdar'] | |||
for k, v in ayat_namdar do | |||
listitems = listitems .. '\n* ' .. v | |||
end | |||
end | |||
end | end | ||
خط ۲۹: | خط ۵۰: | ||
return listitems | return listitems | ||
end | |||
function p.mortabet(frame) | |||
if not getArgs then | |||
getArgs = require('پودمان:Arguments').getArgs | |||
end | |||
args = getArgs(frame) | |||
aye_num = args["aye_num"] | |||
sure_num = args["sure_num"] | |||
sure = args["sure"] | |||
if getData(num_con("fa", sure_num)) then | |||
data = data or getData(num_con("fa", sure_num)) | |||
mortabet = data['mortabet'] | |||
end | |||
local listitems = "" | |||
if not getArgs then | |||
getArgs = require('پودمان:Arguments').getArgs | |||
end | |||
args = getArgs(frame) | |||
sure_num = args["sure_num"] | |||
if getData(num_con("fa", sure_num)) then | |||
data = data or getData(num_con("fa", sure_num)) | |||
mortabet = data['mortabet'] | |||
for k, v in mortabet do | |||
listitems = listitems .. '\n* ' .. v | |||
end | |||
end | |||
end | end | ||
return p | return p |
نسخهٔ ۵ ژوئن ۲۰۲۳، ساعت ۱۶:۴۵
توضیحات این پودمان میتواند در پودمان: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
args = getArgs(frame)
sure_num = args["sure_num"]
if getData(num_con("fa", sure_num)) then
data = data or getData(num_con("fa", sure_num))
ayat_namdar = data['ayat_namdar']
for k, v in 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
args = getArgs(frame)
aye_num = args["aye_num"]
sure_num = args["sure_num"]
sure = args["sure"]
for i = 1, tonumber(num_con("en", aye_num)) do
listitems = listitems ..
'\n* [[آیه ' .. num_con("fa", i) .. ' سوره ' .. sure .. '|'
.. num_con("fa", i) .. ']]'
end
return listitems
end
function p.mortabet(frame)
if not getArgs then
getArgs = require('پودمان:Arguments').getArgs
end
args = getArgs(frame)
aye_num = args["aye_num"]
sure_num = args["sure_num"]
sure = args["sure"]
if getData(num_con("fa", sure_num)) then
data = data or getData(num_con("fa", sure_num))
mortabet = data['mortabet']
end
local listitems = ""
if not getArgs then
getArgs = require('پودمان:Arguments').getArgs
end
args = getArgs(frame)
sure_num = args["sure_num"]
if getData(num_con("fa", sure_num)) then
data = data or getData(num_con("fa", sure_num))
mortabet = data['mortabet']
for k, v in mortabet do
listitems = listitems .. '\n* ' .. v
end
end
end
return p