Module:Param Parse/doc: Difference between revisions

From Brighter Shores Wiki
Jump to navigation Jump to search
Content added Content deleted
(Add {{documentation}})
(yes_no)
Line 25: Line 25:
| episode_smw(episode)
| episode_smw(episode)
| Returns the name of the episode if valid
| Returns the name of the episode if valid
|-
| yes_no(text)
| Only accepts "Yes", "No" and "N/A"
|-
| yes_no_smw(text)
| Maps "Yes", "No" to true and false respectively
|}
|}

Revision as of 01:14, 29 March 2024

This is a documentation subpage for Module:Param Parse.
It contains usage information, categories, and other content that is not part of the original module page.
Module:Param Parse requires Module:Infobox.

These functions are used to validate and format information passed into an Infobox. See Module:Infobox for details and instructions on creating an Infobox. If the information is missing or not valid, the functions here should return nil.

Here is a summary of all the functions:

function name explanation
has_content(arg) Returns arg if any non-whitespace character is found in the string.
image(img) Returns img if any non-whitespace character is found in the string.
image_smw(img) Searches for and returns "File:___.png"
number(num) Removes any commas and parses the string as a number
episode(episode) Returns a plink of the episode, e.g. Hopeport
episode_smw(episode) Returns the name of the episode if valid
yes_no(text) Only accepts "Yes", "No" and "N/A"
yes_no_smw(text) Maps "Yes", "No" to true and false respectively