הבדלים בין גרסאות בדף "יחידה:הערה"
קפיצה לניווט
קפיצה לחיפוש
שמואל חיים (שיחה | תרומות) (הסרת כל התוכן מהדף) תגית: ריקון |
שמואל חיים (שיחה | תרומות) (ביטול גרסה 433198 של שמואל חיים (שיחה)) תגית: ביטול |
||
שורה 1: | שורה 1: | ||
+ | local Ref = {} | ||
+ | function parseRef(frame) | ||
+ | local argModule = require('Module:Arguments') | ||
+ | local warnings='' | ||
+ | local text='' | ||
+ | local refDic = {} | ||
+ | local args = argModule.getArgs(frame) | ||
+ | local refName = args['שם'] | ||
+ | local refGroup = args['קבוצה'] | ||
+ | local direction = args['כיוון'] | ||
+ | |||
+ | |||
+ | if direction and direction ~= 'ימין' and direction ~= 'שמאל' then | ||
+ | warnings = '<span class="error">פרמטר כיוון שגוי</span>[[קטגוריה:דפים עם שגיאות בהערה]]' | ||
+ | end | ||
+ | if args[2] then | ||
+ | warnings = '<span class="error"><sup> פרמטר שני בהערה: </sup></span>[[קטגוריה:דפים עם שגיאות בהערה]]' | ||
+ | end | ||
+ | |||
+ | text = args[1] | ||
+ | |||
+ | if text then | ||
+ | text = frame:preprocess(args[1]) | ||
+ | end | ||
+ | if refName and #refName then refDic['name'] = refName end | ||
+ | if refGroup and #refGroup then refDic['group'] = refGroup end | ||
+ | if direction and direction=='שמאל' then refDic['dir'] = 'ltr' end | ||
+ | if direction and direction=='ימין' then refDic['dir'] = 'rtl' end | ||
+ | |||
+ | if text and #text>0 then | ||
+ | return frame:extensionTag{ name = 'ref', content=text, args = refDic } .. warnings | ||
+ | else | ||
+ | return frame:extensionTag{ name = 'ref', args = refDic } .. warnings | ||
+ | end | ||
+ | end | ||
+ | |||
+ | Ref['הערה'] = parseRef | ||
+ | Ref['parseRef'] = parseRef | ||
+ | return Ref |
גרסה אחרונה מ־00:25, 18 בנובמבר 2020
ניתן ליצור תיעוד על היחידה הזאת בדף יחידה:הערה/תיעוד
local Ref = {}
function parseRef(frame)
local argModule = require('Module:Arguments')
local warnings=''
local text=''
local refDic = {}
local args = argModule.getArgs(frame)
local refName = args['שם']
local refGroup = args['קבוצה']
local direction = args['כיוון']
if direction and direction ~= 'ימין' and direction ~= 'שמאל' then
warnings = '<span class="error">פרמטר כיוון שגוי</span>[[קטגוריה:דפים עם שגיאות בהערה]]'
end
if args[2] then
warnings = '<span class="error"><sup> פרמטר שני בהערה: </sup></span>[[קטגוריה:דפים עם שגיאות בהערה]]'
end
text = args[1]
if text then
text = frame:preprocess(args[1])
end
if refName and #refName then refDic['name'] = refName end
if refGroup and #refGroup then refDic['group'] = refGroup end
if direction and direction=='שמאל' then refDic['dir'] = 'ltr' end
if direction and direction=='ימין' then refDic['dir'] = 'rtl' end
if text and #text>0 then
return frame:extensionTag{ name = 'ref', content=text, args = refDic } .. warnings
else
return frame:extensionTag{ name = 'ref', args = refDic } .. warnings
end
end
Ref['הערה'] = parseRef
Ref['parseRef'] = parseRef
return Ref