| مسابقه دانشدخت | |
| اسلامیکال از تاریخ ۱۵ دی تا ۲۰ بهمن، میزبان یک همایه با موضوع زنان است. شما میتوانید در مسابقه مقالهنویسی دانشدخت، شرکت کنید و با نگارش مقاله، از جوایز آن بهرهمند باشید. اگر به موضوعات مربوط با زنان علاقهمندید، این فرصت را از دست ندهید. فهرستی از مقالات پیشنهادی جهت ایجاد یا ویرایش در اینجا وجود دارد. |
پودمان:Cat main: تفاوت میان نسخهها
پرش به ناوبری
پرش به جستجو
imported>Jeeputer ((درجا)) |
(ساخت رده) |
(بدون تفاوت)
| |
نسخهٔ کنونی تا ۲۵ ژانویهٔ ۲۰۲۳، ساعت ۲۳:۰۰
توضیحات این پودمان میتواند در پودمان:Cat main/توضیحات قرار گیرد.
-- This module implements {{cat main}}.
local mHatnote = require('Module:Hatnote')
local mFormatLink = require('Module:Format link')
local yesno = require('Module:Yesno')
local mTableTools -- lazily initialise
local mArguments -- lazily initialise
local p = {}
function p.catMain(frame)
mTableTools = require('Module:TableTools')
mArguments = require('Module:Arguments')
local args = mArguments.getArgs(frame, {wrappers = {'الگو:Cat main', 'الگو:اصلی رده'}})
local pages = mTableTools.compressSparseArray(args)
local options = {
article = args.article or args['مقاله'],
selfref = args.selfref or args['خودارجاع']
}
return p._catMain(options, unpack(pages))
end
function p._catMain(options, ...)
options = options or {}
-- Get the links table.
local links = mFormatLink.formatPages({}, {...})
if not links[1] then
local page = mw.title.getCurrentTitle().text
links[1] = mFormatLink._formatLink{link = page}
end
for i, link in ipairs(links) do
links[i] = mw.ustring.format("'''%s'''", link)
end
-- Get the pagetype.
local pages = {...}
local pagetype
if options.article ~= nil then
pagetype = yesno(options.article) ~= false and 'مقاله' or 'صفحه'
elseif pages and pages[1] then
local page = mw.ustring.gsub(pages[1], "|.*", "")
pagetype = mw.title.new(page).namespace == 0 and "مقاله" or "صفحه"
else
pagetype = "مقاله"
end
-- Work out whether we need to be singular or plural.
local stringToFormat
if #links > 1 then
stringToFormat = '%sهای اصلی این [[راهنما:رده|رده]]، %s هستند.'
else
stringToFormat = '%sٔ اصلی این [[راهنما:رده|رده]]، %s است.'
end
-- Get the text.
local text = mw.ustring.format(
stringToFormat,
pagetype,
mw.text.listToText(links)
)
-- Pass it through to Module:Hatnote.
local hnOptions = {}
hnOptions.selfref = options.selfref
return mHatnote._hatnote(text, hnOptions)
end
return p