שיחת פורטל:הערה

מתוך גאולהפדיה
גרסה מ־10:22, 17 ביולי 2023 מאת Geula admin (שיחה | תרומות) (מויקיפדיה: https://he.wikipedia.org/wiki/%D7%99%D7%97%D7%99%D7%93%D7%94:%D7%94%D7%A2%D7%A8%D7%94)
(הבדל) → הגרסה הקודמת | הגרסה האחרונה (הבדל) | הגרסה הבאה ← (הבדל)
קפיצה לניווט קפיצה לחיפוש

local Ref = {}

function parseRef(frame) local argModule = require('Module:Arguments') local warnings= local text= local refDic = {} local args = argModule.getArgs(frame) local refName = args['שם'] or args['name'] local refGroup = args['קבוצה'] or args['group'] local direction = args['כיוון']


if direction and direction ~= 'ימין' and direction ~= 'שמאל' then warnings = 'פרמטר כיוון שגוי' end if args[2] then warnings = ' פרמטר שני בהערה: ' 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