Module talk:Portal maintenance status
Appearance
![]() | Portals ![]() | |||||||||
|
Code consolidation
@Evad37: Regarding my recent edit to the module to add the {{Featured portal}} detection code. I feel as though this could have been written better, perhaps by removing the duplication of the template search code. As of now, there are three functions that start by doing the same thing. Would it make sense to make a generic search
function that accepts an argument for the type of template to search for, then return true for that search? If I knew Lua better, I'd work on it myself. Or perhaps it's not worth the trouble right now? — AfroThundr (u · t · c) 03:02, 18 June 2018 (UTC)
- Most of the potential duplication is already avoided, as all three entry points uses the functions getSubjectPageContent and makeTemplatePattern. Further consolidation is possible, but may be more appropriate as a function in Module:Excerpt (that would return the wikitext of a template invocation for a given page and template name) - Evad37 [talk] 07:53, 19 June 2018 (UTC)