Module:Availability/Data/doc
This is the documentation page for Module:Availability/Data
Module documentation (view)
Usage
This is the subpage for Module:Availability, and stores the data needed for the module to function and outputs the availability of each source.
Inserting a new source/availability
["name_of_source"] = { "source_image", "source_image_size", "link_to_source", "name_of_source", "special_text_for_source" }
When adding a new source or availability to be used on pages, the following syntax must be inserted into the main data table on Module:Availability/Data. Note that this should not be done to villagers; they are separately called in the template via its own section in the Lua module.
name_of_sourcedescribes the name of the source that the editor will write in the Availability template. There is also a second instance ofname_of_source, which can also feature a different text to its first instance. To use thespecial_text_for_sourceparameter for certain instances (e.g. File:Flower Icon HHP.png Paradise Planning office and File:Snake's Ninja Cookie PC Icon.png Snake's ninja cookie), leave the second instance blank.source_imagerequires an image (preferably an icon) to be added. It must include the filename extension.source_image_sizedescribes the default size thatsource_imagewill be presented in.link_to_sourcedescribes the link that the player will click on (provided that the link is present). To use thespecial_text_for_sourceparameter for certain instances (e.g. File:Flower Icon HHP.png Paradise Planning office and File:Snake's Ninja Cookie PC Icon.png Snake's Ninja Cookie), leave this blank.special_text_for_sourceis optional, and is used to display specialized wikitext.
Each source must then be added under their appropriate section.
Example
["Isabelle"] = { "Isabelle NH Character Icon.png", "22px", "Isabelle", "Isabelle", "[[Isabelle]]" }
"Isabelle" is the name_of_source in both instances that it appears. "Isabelle" is also the link_to_source and has a special wikitext presented in special_text_for_source, although it will be unused in this instance. Its source_image is "Isabelle NH Character Icon.png", and the source_image_size is set to "22px".
The output is:
Isabelle
["Punchy's crunch cookie"] = { "Punchy's Crunch Cookie PC Icon.png", "20px", "", "", "Punchy's crunch cookie" }
"Punchy's crunch cookie" is the name_of_source, but it is blank in its second instance, along with its link_to_source. Its source_image is "Punchy's Crunch Cookie PC Icon.png", and the source_image_size is set to "20px". Its special_text_for_source is simply "Punchy's crunch cookie", and will provide no links at all.
The output is: File:Punchy's Crunch Cookie PC Icon.png Punchy's crunch cookie