Template talk:Ig

From DoomWiki.org

Replacing this with Template:Idgames[edit]

See overall proposal here.  Feel free to edit this post if needed; I'm permalinking in anticipation of multiple drafts.

Cases 7 through 10 are obviously not exhaustive, but they encompass all the real transclusions I was able to find.  (In particular there are ways of entering contradictory parameter values, which all editors thus far seem to have avoided!  That implies a very low risk of accidentally creating broken links during this task.)  If there are stragglers after the bot's main run, I'll migrate those manually.

For backward compatibility we have to set the linkonly flag 100% of the time (unless, per the documentation, the original editor had supplied neither file nor ID values, but it appears there are no live examples).

As in prior scripted tasks, I'm assuming it's OK to be more fastidious with syntax than a human would be, for ease of debugging.  I have no intention of removing existing shortcuts from Template:Idgames, in case humans continue to find them convenient.

Case 1: File as first named parameter without extension, no other parameters
Preserve the file value and assign "Doomworld/idgames" as the title (it's the default here but not in the older template).
Case 2: File as first named parameter including extension, no other parameters
Strip off the extension per the third bullet here, then treat as case 1.
Case 3: File as first named parameter without extension, title as named parameter
Preserve the file and title values respectively.
Case 4: File as first named parameter including extension, title as named parameter
Strip off the extension, then treat as case 3.
Case 5: File as first named parameter without extension, title as unnamed parameter
Preserve the file and title values respectively.  I couldn't find any situations where a file was the first named parameter, followed by multiple unnamed parameters, so I suggest it is safe to treat the second parameter as a title unconditionally.
Case 6: File as first named parameter including extension, title as unnamed parameter
Strip off the extension, then treat as case 5.
Case 7: ID as first named parameter, no other parameters
Preserve the ID value and assign "Doomworld/idgames" as the title (similar to case 1).  If Xymph agrees to make a subsequent pass to synchronize IDs and file paths as stated here, then arguably this does not violate the letter of the documentation. :>
Case 8: ID as first named parameter, title as named parameter
Preserve the ID and title values respectively.
Case 9: ID as first named parameter, title as unnamed parameter
Preserve the ID and title values respectively (same proviso as case 5).
Case 10: ID as first named parameter, title as unnamed parameter, link text as subsequent unnamed parameter which is ignored
Hmmm.  This might be an attempt to include hover text, which isn't supported.  Based on the examples I've seen, I tentatively propose preserving the ID and concatenating the strings, e.g. title (link text).  That might be awkward or stylistically wrong.  Is there a way to list all occurrences beforehand, so perhaps our regular "body of work" contributors can opine?

Examples[edit]

Case Source Before After
1 link {{ig|file=deathmatch/skulltag/spacedm9}} {{idgames|file=deathmatch/skulltag/spacedm9|title=Doomworld/idgames|linkonly=1}}
2 link {{ig|file=levels/doom/a-c/bobkdv_2.zip}} {{idgames|file=levels/doom/a-c/bobkdv_2|title=Doomworld/idgames|linkonly=1}}
3 link {{ig|file=graphics/q3dmtxtr|title=graphics/q3dmtxtr}} {{idgames|file=graphics/q3dmtxtr|title=graphics/q3dmtxtr|linkonly=1}}
4 link {{ig|file=docs/misc/doomfont.zip|title=Doom-like font}} {{idgames|file=docs/misc/doomfont|title=Doom-like font|linkonly=1}}
5 link {{ig|file=levels/doom/deathmatch/a-c/ayrton_2|Ayrton 2}} {{idgames|file=levels/doom/deathmatch/a-c/ayrton_2|title=Ayrton 2|linkonly=1}}
6 link {{ig|file=levels/doom2/Ports/megawads/dsv4_rvltinL.zip|Legacy Edition}} {{idgames|file=levels/doom2/Ports/megawads/dsv4_rvltinL|title=Legacy Edition|linkonly=1}}
7 link {{ig|id=5847}} {{idgames|id=5847|title=Doomworld/idgames|linkonly=1}}
8 link {{ig|id=9941|title=Scary Mike}} {{idgames|id=9941|title=Scary Mike|linkonly=1}}
9 link {{ig|id=156|E2MUSIC.WAD}} {{idgames|id=156|title=E2MUSIC.WAD|linkonly=1}}
10 link {{ig|id=12747|idgames|full hub}} {{idgames|id=12747|title=idgames (full hub)|linkonly=1}}

HTH.  Ryan W (living fossil) 19:38, 22 January 2020 (CST)