Модуль:Тарашкевіца
Выгляд
Дакументацыю да гэтага модуля можна стварыць у Модуль:Тарашкевіца/Дакументацыя
local prereformSpelling = {}
local header = require ("Module:Header") -- для parse_title()
function prereformSpelling.variative( frame )
return prereformSpelling.variativeImpl( frame, frame:getArgument(1), frame:getArgument(2) );
end
function prereformSpelling.variativeImpl( frame, oldStyle, newStyle )
local isPage = (mw.title.getCurrentTitle().namespace == 104);
if (isPage) then
return '__NOEDITSECTION____NOTOC__' .. oldStyle.expand() .. '\n' .. frame:extensionTag('references') .. '\n' ..
'<div class="newspell" style="margin:1em 0; text-align:center; background-color:#DDDDDD; font-size: 120%; font-weight:bold;">Той жа тэкст у сучаснай арфаграфіі </div>\n' ..
newStyle.expand();
end
local tarask = header.parse_title (mw.title.getCurrentTitle().text, "tarask")
if (tarask) then
return oldStyle.expand();
else
return newStyle.expand();
end
end
function prereformSpelling.variative2( frame )
return prereformSpelling.variative2Impl( frame:getArgument(1), frame:getArgument(2) );
end
function prereformSpelling.variative2Impl( oldStyle, newStyle )
local isPageOrIndex = (mw.title.getCurrentTitle().namespace == 104) or (mw.title.getCurrentTitle().namespace == 106);
if (isPageOrIndex) then
return oldStyle.expand();
end
local tarask = header.parse_title (mw.title.getCurrentTitle().text, "tarask")
if (tarask) then
return oldStyle.expand();
else
return newStyle.expand();
end
end
return prereformSpelling