User:WindBOT/Filters: Difference between revisions

Jump to navigation Jump to search
Line 97: Line 97:
         #'Good template name': ['Bad template lowercase name 1', 'Bad template lowercase name 2', 'Bad template lowercase name 3'],
         #'Good template name': ['Bad template lowercase name 1', 'Bad template lowercase name 2', 'Bad template lowercase name 3'],
         # Last line has no comma at the end
         # Last line has no comma at the end
         'Crush': ['pngcrush']
         'Crush': ['pngcrush'],
        'Chamber infobox': ['test chamber infobox']
     }
     }
     for n in templateMap:
     for n in templateMap:
Line 104: Line 105:
     return t
     return t
  addTemplateFilter(templateRenameMapping)
  addTemplateFilter(templateRenameMapping)
=== Reindent all infoboxes ===
def infoboxIndentFilter(t, **kwargs):
    itemInfoboxes = ('game infobox', 'website infobox', 'item infobox', 'company infobox', 'chamber infobox', 'old aperture infobox', 'twtm chamber infobox', 'mel old aperture infobox')
    tName = t.getName().lower()
    if 'infobox' in tName and tName not in itemInfoboxes:
        t.indentationMatters(True)
        t.setDefaultIndentation(2)
    return t
addTemplateFilter(infoboxIndentFilter, lowPriority=True)


=== Remove useless templates ===
=== Remove useless templates ===