--
p = ;pp = require('Module:Sandbox/Smalljim/ParsePageTest'); --a set of page parsing functions
function p.summary(frame) local target = frame.args[1] or frame.args.target or ; --the page to parse local exc = frame.args.excerpts or false; --opt to show an excerpt from start of each section if type(exc)
'false' or exc
'0' or exc
if target
return frame:preprocess(p._summary(text, target, exc, rt, ot));end function p._summary(text, target, exc, rt, ot) local lang = mw.getContentLanguage; local now = lang:formatDate('U'); local sections, headings = pp.getSections(text, 2); --2 is header level local result; result = '
\n\n' result = result .. 'This is an automated summary of the discussions occurring on ' .. target .. '.\n\n' .. 'It was last generated at ' .. lang:formatDate('l, j F Y, H:i:s') .. ' UTC ' .. '([{{fullurl:{{FULLPAGENAME}}|action=purge}} update now]).\n\n' .. 'The current version of this report is still experimental and may contain ' .. 'significant inaccuracies.\n\n' if exc then result = result .. '
' .. tv_string; --green cell elseif tv > ot then tv_string = ' style="background:#FEE" | ' .. tv_string; --red cell end return tv_string;end return p; |