Module:TFA subpage transcluder
Jump to navigation
Jump to search
File:Test Template Info-Icon - Version (2).svg Module documentation[view] [edit] [history] [purge]
| File:Greek lc beta icon.svg | This module is rated as beta. It is considered ready for widespread use, but as it is still relatively new, it should be applied with some caution to ensure results are as expected. |
| File:Lua-Logo.svg | This module depends on the following other modules: |
This template silently transcludes subpages of {{TFA title}} to keep them out of Special:UnusedTemplates. It takes a single parameter: the first date to transclude. The module will then record transclusions of all subpages from that date until the current day. For example, {{#invoke:TFA subpage transcluder|main|November 29, 2025}}. It returns the number of pages transcluded.
It is highly unlikely that this module will be helpful outside of WP:USED.
local p = {}
local Date = require('Module:Date')._Date
local getArgs = require('Module:Arguments').getArgs
function p.main(frame)
local args = getArgs(frame) -- get the args
local currentProcessingDate = Date(args[1]) -- init the current processing date
local now = Date('currentdate') -- set up as today as a Date table
local dummy = '' -- dummy variable (only used so we Do Something with each date transclusion)
local count = 0 -- init the days counter
while currentProcessingDate <= now do
dummy = mw.title.new('Template:TFA title/' .. currentProcessingDate:text('mdy')).content
count = count + 1 -- increment the count of pages checked
currentProcessingDate = currentProcessingDate + '1 day' -- move on the the next day
end
return count
end
return p