![]() |
VOOZH | about |
Tracks argument names that set in a specific template, include empty arguments, whether meanful in that template.
Add the following content into a template:
{{ #invoke: ArgTracker | main | _cat = Category name for tracking }}
|_cat= should contain and only contains one %s, which refers the name of the tracked argument. Defaults to %s.
Categories added by this module can usually find in Special:WantedCategories after pages updated.
localp={} functionp.main(f) localargs=f localframe=mw.getCurrentFrame() iff==framethen args={} localparentArgs=frame:getParent().args localselfArgs=frame.args fork,vinpairs(parentArgs)do args[k]=v end fork,vinpairs(selfArgs)do ifnotargs[k]then args[k]=v end end end localcategory=string.format('[[Category:%s]]',args['_cat']or'%s') localcategories={} fork,_inpairs(args)do ifk~='_cat'then table.insert(categories,category:format(k)) end end returntable.concat(categories) end returnp