לדלג לתוכן

יחידה:הערה: הבדלים בין גרסאות בדף

מתוך צפונות ויקי
מאין תקציר עריכה
מאין תקציר עריכה
שורה 13: שורה 13:
end
end
if args['שמאל'] then
if args['שמאל'] then
text = '<div style="direction: ltr;text-align:left;">' .. frame:preprocess(args[1]) .. '</div>'
text = '<div style="direction: ltr;text-align:left;">' .. args[1] .. '</div>'
else
else
text = args[1]
end
if text then
text = frame:preprocess(args[1])
text = frame:preprocess(args[1])
end
end
 
if refName and #refName then refDic['name'] = refName end
return frame:extensionTag{ name = 'ref', content=text, args = { name = refName, group = refGroup } } .. warnings
if refGroup and #refGroup then refDic['group'] = refGroup end
if text then
return frame:extensionTag{ name = 'ref', content=text, args = refDic } .. warnings
else
return frame:extensionTag{ name = 'ref', args = refDic } .. warnings
end
end
end


Ref['הערה'] = parseRef
Ref['הערה'] = parseRef
return Ref
return Ref

גרסה מ־20:30, 28 בפברואר 2017

ניתן ליצור תיעוד על היחידה הזאת בדף יחידה:הערה/תיעוד

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['קבוצה']
	if args[2] then
		warnings = '<span class="error"><sup> פרמטר שני בהערה: </sup></span>[[קטגוריה:דפים עם שגיאות בהערה]]'
	end
	if args['שמאל'] then
		text = '<div style="direction: ltr;text-align:left;">' .. args[1] .. '</div>'
	else
		text = args[1]
	end
	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 text then
		return frame:extensionTag{ name = 'ref', content=text, args = refDic } .. warnings
	else
		return frame:extensionTag{ name = 'ref', args = refDic } .. warnings
	end
end

Ref['הערה'] = parseRef
return Ref