Content deleted Content added
remove format support: no one was using the hlist version; some code style adjustments in the main function |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 21:
local res = {}
table.insert(res, '__NOTOC__<table role="navigation" id="toc" class="calendar-toc wikitable toc
table.insert(res, '<tr><th colspan=7
table.insert(res, '<tr><th scope="col">' .. table.concat(weekdays, '</th><th scope="col">') .. '</th></tr>')
Line 75:
return table.concat(res, '\n')
local starttxt = [[▼
end
Line 143 ⟶ 117:
local pargs = frame:getParent().args
local current_title = mw.title.getCurrentTitle()
local pagename = current_title.text▼
local content = current_title:getContent()
if args['_demo'] or pargs['_demo'] then
Line 160 ⟶ 131:
-- Get the month and year
▲ local pagename = current_title.text
local month = getMonth(pagename, args['month'] or pargs['month'] or '')
local year = getYear(pagename, args['year'] or pargs['year'] or '')
Line 180 ⟶ 152:
local founddays = {}
local footer = {}
for v in mw.ustring.gmatch(content, "%f[^\n]==%s*([^\r\n]-)%s*==%f[^=]") do
v = mw.ustring.gsub(v,'^[=%s]*(.-)[%s=]*', '%1')
Line 197 ⟶ 170:
end
▲ return caltoc(days, unknown, footer, month, year)
end
|