Module:Param Parse: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
No edit summary |
No edit summary |
||
Line 6: | Line 6: | ||
local parse = {} |
local parse = {} |
||
-- Generic functions -- |
|||
----------------------- |
|||
-- Standardized "has content" function |
-- Standardized "has content" function |
||
Line 13: | Line 15: | ||
end |
end |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
['N/A'] = 'NIL', |
|||
} |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
-- Premade Params -- |
|||
-------------------- |
|||
-- Standardized name function |
|||
parse.name = { |
|||
name = 'name', |
|||
func = parse.has_content, |
|||
smw_property = 'Name', |
|||
} |
|||
-- Standardized image function |
-- Standardized image function |
||
Line 30: | Line 66: | ||
smw_func = parse.image_smw, |
smw_func = parse.image_smw, |
||
empty = '[[Special:Upload|Please upload an image!]]', |
empty = '[[Special:Upload|Please upload an image!]]', |
||
category_incomplete = 'Needs image' |
category_incomplete = 'Needs image', |
||
} |
} |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
-- Episode |
-- Episode |
||
local valid_episodes = {['Hopeport'] = 1, ['Hopeforest'] = 1, ['Mine of Mantuban'] = 1, ['Crenopolis'] = 1} |
local valid_episodes = {['Hopeport'] = 1, ['Hopeforest'] = 1, ['Mine of Mantuban'] = 1, ['Crenopolis'] = 1} |
||
function parse. |
function parse.episode_func(episode) |
||
if valid_episodes[episode] then |
if valid_episodes[episode] then |
||
return '[[File:'..episode..' episode icon.png|18px]] [['..episode..']]' |
return '[[File:'..episode..' episode icon.png|18px]] [['..episode..']]' |
||
Line 55: | Line 84: | ||
return nil |
return nil |
||
end |
end |
||
parse.episode = { |
|||
name = 'episode', |
|||
func = parse.episode_func, |
|||
smw_property = 'Episode', |
|||
smw_func = parse.episode_smw, |
|||
category_incomplete = 'Needs episode', |
|||
} |
|||
-- Premium |
|||
parse.premium = { |
|||
⚫ | |||
name = 'premium', |
|||
⚫ | |||
func = parse.yes_no, |
|||
smw_property = 'Premium', |
|||
⚫ | |||
smw_func = parse.yes_no, |
|||
⚫ | |||
category_incomplete = 'Needs premium status', |
|||
} |
} |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||