Editing Module:IL
From Fallen London Wiki (Staging)
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 3: | Line 3: | ||
local workarounds = require('Module:Workarounds') | local workarounds = require('Module:Workarounds') | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
function p.IL_with_args(page, quantity, appearance, property, image, size, link, small) | function p.IL_with_args(page, quantity, appearance, property, image, size, link, small) | ||
if not appearance then | if not appearance then | ||
Line 74: | Line 59: | ||
local image_link = '[[File:' .. image .. '|' .. size .. '|link=' .. link .. '|alt=]]' | local image_link = '[[File:' .. image .. '|' .. size .. '|link=' .. link .. '|alt=]]' | ||
local page_link_text = '[[' .. page .. (appearance and '|' .. appearance or '') .. ']]' | local page_link_text = '[[' .. page .. (appearance and '|' .. appearance or '') .. ']]' | ||
− | |||
− | |||
-- replace !! with !!, probably to escape it? This was already in the original template: I'm blaming [[Tale of Terror!!]] | -- replace !! with !!, probably to escape it? This was already in the original template: I'm blaming [[Tale of Terror!!]] | ||
Line 86: | Line 69: | ||
local output = mw.html.create('span') | local output = mw.html.create('span') | ||
:addClass(class) | :addClass(class) | ||
− | + | :wikitext(image_link .. ' ' .. page_link_text) | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
return tostring(output) | return tostring(output) | ||
end | end | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
function p.IL(frame) | function p.IL(frame) | ||
local page = workarounds.get_arg(frame, 1) | local page = workarounds.get_arg(frame, 1) | ||
local quantity = workarounds.get_arg(frame, 2) | local quantity = workarounds.get_arg(frame, 2) | ||
− | local appearance = frame | + | local appearance = workarounds.get_arg(frame, 'Appearance') |
− | |||
− | |||
local property = workarounds.get_arg(frame, 'Property') | local property = workarounds.get_arg(frame, 'Property') | ||
local image = workarounds.get_arg(frame, 'Image') | local image = workarounds.get_arg(frame, 'Image') |