יחידה:קצרמר
ויקיפדיה האנציקלופדיה encyclopedia
local jsonlist = mw.text.jsonDecode(mw.title.new('קצרמר/list.json','Module'):getContent())
local defcode = {"
"|", "]]. אם בכוונתך להרחיב את הערך, ניתן לשקול שימוש במידע שהיה בו ונמחק בגלל בעייתיות מסוימת, [",
" כאן]. אתם מוזמנים לתרום לוויקיפדיה ולהרחיב אותו.[[קטגוריה:קצרמר ", "]] "}
local errcode = '
'קצרמר, אך הוא סווג כקצרמר מסוג שאינו ברשימת הקצרמרים בוויקיפדיה העברית.' ..
' נא לתקן ולבחור שם מהרשימה.'
local catcode = {"{{[[:קטגוריה:קצרמר ",
"|קצרמר|",
"]]}}"}
local catstartcode = "{{קצרמר}} לא בשימוש:" ..
" מותר רק קצרמר ספציפי: {{קצרמר|סוג הקצרמר}}[1]"
function main(frame) local parentargs = frame:getParent().args local entry = parentargs[1] or 'כללי' local param2 = parentargs[2] or local parammidanosaf = parentargs['מידע נוסף'] or local paramnocategory = parentargs['NoCategory'] or local paramnocategoryyes = parentargs['NoCategory'] or 'yes' local catanswer = mw.ustring.format('%s%s|%s%s', '
- ')
local ans = getparams(entry, jsonlist) if (not ans) then return frame:preprocess(errcode .. catanswer) end if (entry == 'כללי') then param2 = end if (entry == 'שונות') then param2 = parammidanosaf = end return frame:preprocess(mw.ustring.format('%s%s%s%s%s%s|%s%s%s|%s%s', defcode[1], ans[2], defcode[2], param2, defcode[3], parammidanosaf, ans[1], defcode[4], paramnocategory, paramnocategoryyes, defcode[5]) .. catanswer) end
function getparams(entry, tab) local value = tab[entry] if (not value or type(value) == "table") then return value end return {value, entry} end
function templatedata(frame) local ans = {} for k, v in pairs( jsonlist ) do table.insert(ans, k) end table.sort(ans) return table.concat(ans, ', ') end
function categories(frame) local ans = {} local param for k, v in pairs( jsonlist ) do if (k ~= 'כללי') then if (type(v) == "table") then param = v[2] else param = k end table.insert(ans, mw.ustring.format("%s%s%s%s%s", catcode[1], param, catcode[2], k, catcode[3])) end end table.sort(ans)
return frame:preprocess('
- ' .. catstartcode .. '
- ' .. table.concat(ans, '
- ') .. '
end
return {main = main, templatedata = templatedata, categories = categories}
- קצרמר לא ספציפי" .. " יוצר שגיאה פרמטרית