Модуль:Песочница/Pok: различия между версиями
Pok (обсуждение | вклад) мНет описания правки |
Pok (обсуждение | вклад) Нет описания правки |
||
| Строка 1: | Строка 1: | ||
local p = {} | local p = {} | ||
function p. | function p.increment(frame) | ||
local | local content = mw.title.getCurrentTitle():getContent() | ||
local currentCount = tonumber(content:match('<!--callCount:(%d+)-->')) or 0 | |||
local newCount = currentCount + 1 | |||
mw.title.getCurrentTitle():edit(content .. '\n<!--callCount:' .. newCount .. '-->') | |||
return "Количество вызовов: " .. newCount | |||
end | end | ||
return p | return p | ||