User:SilverTiger12/Sandbox

Appearances
What it could look like, as a compromise ideally (when appears in base games + expansions):

Neverwinter Nights series (Neverwinter Nights • Darkness over Daggerford • Neverwinter Nights 2 • Storm of Zehir • Mysteries of Westgate)

Baldur's Gate series (Baldur's Gate • Tales of the Sword Coast • Baldur's Gate II: Shadows of Amn • Throne of Bhaal • Baldur's Gate III'')

And if the base games aren't an appearance, should still display as:

Neverwinter Nights series (Neverwinter Nights: Darkness over Daggerford • Neverwinter Nights 2: Storm of Zehir • Mysteries of Westgate)

Baldur's Gate series (Baldur's Gate: Tales of the Sword Coast • Baldur's Gate II: Throne of Bhaal • Baldur's Gate III)

If a switch in a single template can't handle it, then maybe the compromise can be an extra template:

Index
An idea for two formatting templates that could potentially also aid further appearance-automation in the future.

Input looks like:

To generate the equivalent of:
 * Creatures
 * Creature1 • Creature2 • Creature3
 * Creature4 • Creature5 • Creature6
 * Creature4 • Creature5 • Creature6

Hmm...

OR

|


 * Referenced only |


 * Creature
 * foo * bar * woo


 * foo * bar * woo

Ambitions increase: turn it into one template!

Input appears as:


 * Referenced only
 * Referenced only
 * Referenced only

The fact that it can't handle more than 1,000 characters per parameter is frustrating, as is the persistant whitespace issues. Might have to try and convert to a Lua module.

local Index = {} --- imported libraries -- Parses invocation and template parameters, trims whitespace, and removes blanks. local getArgs = require('Dev:Arguments').getArgs -- Output build string local output = '' -- Separator used between items in the in-line list local sep = ' &bull; '

Where handle title parameter?

local function small(str) return ' '..str..' ' end -- Referenced only header local refonly = ..small('Referenced only')..

local function blockIndent(str) return ' '..str..' ' end -- function Index.AppList(frame) -- interprets parameters local args = getArgs(frame) -- calls the internal function that does most of the work -- sends the result back to the template / article return Index._AppList(args) end

function Index._AppList(args) if args[''] then output = output..blockIndent(args[''] or '') end if args[''] output = output..blockIndent(refonly..' '..small(args[''])) end -- Change all semicolons to the separator character string output = string.gsub(output, ';', sep) -- Indent the whole thing output = blockIndent(output) return output end

return Index