跳至內容

模組:修訂追蹤

出自Taiwan Tongues 台語維基
於 2025年8月19日 (二) 23:46 由 Admin留言 | 貢獻 所做的修訂 (建立內容為「local p = {} function p.display() local frame = mw.getCurrentFrame() local dataPage = '維基百科:修訂追蹤資料庫' local content = mw.title.new(dataPage):getContent() or '' local rows = {} for line in mw.text.gsplit(content, '\n') do local title, user, date = string.match(line, '{{(.-)|([^|]+)|([^}]+)}}') if title and user and date then table.insert(rows, string.format('|-\n| %s || User:%s || %…」的新頁面)

(差異) ←上個修訂 | 已批准修訂 (差異) | 最新修訂 (差異) | 下個修訂→ (差異)

local p = {} function p.display()

   local frame = mw.getCurrentFrame()
   local dataPage = '維基百科:修訂追蹤資料庫'
   local content = mw.title.new(dataPage):getContent() or 
   local rows = {}
   for line in mw.text.gsplit(content, '\n') do
       local title, user, date = string.match(line, '模板:(.-)')
       if title and user and date then
           table.insert(rows, string.format('|-\n| %s || User:%s || %s', title, user, date))
       end
   end
   local header = '{| class="wikitable sortable"\n! 條目 !! 參與者 !! 起始日期\n'
   local footer = '\n|}'
   return header .. table.concat(rows, '\n') .. footer

end

return p