Изменения

Перейти к навигации Перейти к поиску
Строка 63: Строка 63:  
local endl = args._endl or ''
 
local endl = args._endl or ''
 
local prefix = args._prefix or args['_pre-text'] or ''
 
local prefix = args._prefix or args['_pre-text'] or ''
local postfix = args._postfix or args['_post-text'] or ''
+
local postfix = args._postfix or args['_post-text'] or ''
local comment = args._comment or args._after -- полезно в шаблоне {{стопка примеров}} (это просто текст в конце)
+
local comment_sep = args._comment_sep or ' '      -- передаётся шаблоном {{стопка примеров}}, один разделитель на все примеры
local comment_sep = args._comment_sep or ' '
+
local after = args._after or args._comment or ''  -- полезно в шаблоне {{стопка примеров}} (это просто текст в конце)
 +
local before = args._before or ''                 -- полезно в шаблоне {{стопка примеров}} (это просто текст в начале)
 
local nobr = yesno(args._nobr, false)
 
local nobr = yesno(args._nobr, false)
 
local spaced = yesno(args._spaced, false)
 
local spaced = yesno(args._spaced, false)
Строка 71: Строка 72:  
local style = args._style
 
local style = args._style
 
 
 +
after = after and comment_sep .. after
 
if style == 'pre' then
 
if style == 'pre' then
 
tag = nil
 
tag = nil
Строка 92: Строка 94:  
comment_sep = '\n|'
 
comment_sep = '\n|'
 
end
 
end
 +
 
local nwt = tag and mw.html.create(tag):tag(tag) --"no-wiki tag", внутри него шаблон не вызывается
 
local nwt = tag and mw.html.create(tag):tag(tag) --"no-wiki tag", внутри него шаблон не вызывается
 
if nwt and nobr then
 
if nwt and nobr then
Строка 109: Строка 112:  
tname = mw.language.new('ru'):lcfirst(mw.title.getCurrentTitle().rootText)
 
tname = mw.language.new('ru'):lcfirst(mw.title.getCurrentTitle().rootText)
 
end
 
end
 
+
 
if args._template == nil then --имя вызываемого шаблона в неименованном первом параметре (или же взято из названия страницы или
 
if args._template == nil then --имя вызываемого шаблона в неименованном первом параметре (или же взято из названия страницы или
 
                          --из именованного параметра в отсутствие неименованных — в следующей строчке вреда нет в любом случае),
 
                          --из именованного параметра в отсутствие неименованных — в следующей строчке вреда нет в любом случае),
Строка 162: Строка 165:  
end
 
end
 
 
return tostring(nwt) .. ' ' .. sep .. prefix .. expand_result .. postfix .. (comment and comment_sep .. comment or '')
+
return before .. tostring(nwt) .. ' ' .. sep .. prefix .. expand_result .. postfix .. after
 
end
 
end
    
return p
 
return p
Анонимный участник

Реклама:

Навигация