GuildWiki talk:Bot tasks/Template substitution

With Pan's approval, I think we should also replace all occurences of his signature which used to be transcluded with a substitution as well. I don't know if this would apply to anyone else. &mdash;♥ Jedi ♥ Rogue ♥ 00:09, 1 May 2008 (UTC)

couple questions
This may only because I'm not familiar with your coding language again, but this appears to only function on templates that are in the template namespace. Things like transcluded signatures or correcting missused templates from the userspace (or whatever) or some other transcluded content, it doesn't handle that input (minor issue). The other thing is the case of the first letter. It might have been upper or lowercase in the usage. Do you account for that? Also, you're not losing the template's paramters when you make the change are you? &mdash;♥ Jedi ♥ Rogue ♥ 16:11, 1 May 2008 (UTC)


 * I hadn't thought of mainspace inclusions, good point, I'll work on that one. I had thought of case, though - the final "i" on each of the "$text =~" lines is a flag that tells the regex engine to match case-insensitively (the "g" flag makes it work "globally", i.e, find all matches within the string).  And it's not losing the parameters: on the left side of the substitutions (s/*here*/.../gi), the part in parentheses gets captured to the variable $1.  As you can see, I capture the entirety of what was within the  and then re-insert it with "subst:" in front.  &mdash;Dr Ishmael [[Image:Diablo_the_chicken.gif]] 16:34, 1 May 2008 (UTC)

More templates to get rid of

 * Template:If-Then
 * Template:If-Then-Else
 * Template:Test

There's also Template:Switch, though it's not really a simple subst, but requires a regex replace instead. -User:PanSola (talk to the ) 13:04, 3 May 2008 (UTC)