PhantomCaleb (talk | contribs) No edit summary |
PhantomCaleb (talk | contribs) No edit summary |
||
Line 519: | Line 519: | ||
required = true, |
required = true, |
||
type = "string", |
type = "string", |
||
− | enum = {"canon", "ambiguous", "non-canon |
+ | enum = {"canon", "ambiguous", "non-canon"}, |
desc = "The title's [[Guidelines:Canon|canon status]].", |
desc = "The title's [[Guidelines:Canon|canon status]].", |
||
trim = true, |
trim = true, |
||
Line 707: | Line 707: | ||
before = "<!--\n-->", |
before = "<!--\n-->", |
||
}, |
}, |
||
− | paramOrder = {"code", "page", "shortName", "logo", "releaseDate", "canonicity", "link", "display"}, |
+ | paramOrder = {"code", "page", "shortName", "logo", "releaseDate", "canonicity", "link", "display", "titles"}, |
params = { |
params = { |
||
code = { |
code = { |
||
Line 763: | Line 763: | ||
nilIfEmpty = true, |
nilIfEmpty = true, |
||
}, |
}, |
||
+ | titles = { |
||
+ | required = true, |
||
+ | type = "string", |
||
+ | desc = "Comma-separated list of franchise entries covered in the compilation.", |
||
+ | split = true, |
||
+ | trim = true, |
||
+ | nilIfEmpty = true, |
||
+ | } |
||
}, |
}, |
||
examples = { |
examples = { |
||
Line 774: | Line 782: | ||
link = "", |
link = "", |
||
display = "", |
display = "", |
||
+ | titles = "TLoZ, TAoL, ALttP, ..., SS, ALBW, TFH", |
||
} |
} |
||
} |
} |
Revision as of 18:29, 25 July 2020
Lua interface for Data:Franchise.
This is the main module for the following templates:- Template:Franchise/Store Book
- Template:Franchise/Store Game
- Template:Franchise/Store Group
- Template:Franchise/Store Nonfiction
- Template:Franchise/Store TV
All Media
enum
enum([includeSeries])
See also enumGames.
Parameters
[includeSeries]
- If true, then
Series
is included at the very beginning of the list.
Returns
- An array of all codes in canon order, plus a
reference
key so that it can be used for documentation and validation.
Examples
# | Input | Output | Status | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | local enum = Franchise.enum()
return utilsTable.take(enum, 10)
| {
"TLoZ",
"TAoL",
"ALttP",
"LA",
"LADX",
"LANS",
"OoT",
"OoT3D",
"MM",
"MM3D",
}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 | return Franchise.enum().reference
| "[[Data:Franchise]]" | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
When includeSeries is true, then Series is the first item in the enum. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3 | local enum = Franchise.enum({
includeSeries = true,
})
return utilsTable.take(enum, 3)
| {"Series", "TLoZ", "TAoL"}
|
canonicity
canonicity(code)
Returns
- A string:
canon
,ambiguous
, ornon-canon
.
Examples
# | Input | Output | Status |
---|---|---|---|
4 | canonicity("LA")
| "canon" | |
5 | canonicity("la")
| "canon" | |
6 | canonicity("CoH")
| "ambiguous" | |
7 | canonicity("LA (Cagiva)")
| "non-canon" | |
8 | canonicity("fake")
| nil
|
logo
logo(code)
Returns
- Filename for the title's logo.
Examples
# | Input | Output | Result | Status | ||||
---|---|---|---|---|---|---|---|---|
9 | logo("LANS")
|
| File:LANS English Logo 2.png | |||||
10 | logo("lans")
|
| File:LANS English Logo 2.png | |||||
11 | logo("Series")
| "File:Zelda Logo TP.png" | File:Zelda Logo TP.png | |||||
12 | logo("fakeGame")
| nil
|
link
link(code)
Returns
- Formatted link used in infoboxes and so on.
Examples
# | Input | Output | Result | Status | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
13 | link("LA")
| "''[[The Legend of Zelda: Link's Awakening|Link's Awakening]]''" | Link's Awakening | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
14 | link("la")
| "''[[The Legend of Zelda: Link's Awakening|Link's Awakening]]''" | Link's Awakening | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
15 | link("LADX")
| "''[[The Legend of Zelda: Link's Awakening DX|Link's Awakening DX]]''" | Link's Awakening DX | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
16 | link("LANS")
|
| Link's Awakening for Nintendo Switch | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
For books, comics and manga, see also phraseLink. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
17 | link("LA (Cagiva)")
| "[[The Legend of Zelda: Link's Awakening (Cagiva)|''Link's Awakening'' (Cagiva)]]" | Link's Awakening (Cagiva) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
18 | link("fakeGame")
| nil
|
display
display(code)
Returns
- Formatted text for the title
Examples
# | Input | Output | Result | Status |
---|---|---|---|---|
19 | display("LA")
| "''Link's Awakening''" | Link's Awakening | |
20 | display("la")
| "''Link's Awakening''" | Link's Awakening | |
21 | display("LANS")
| "''Link's Awakening'' for Nintendo Switch" | Link's Awakening for Nintendo Switch | |
22 | display("Series")
| "''The Legend of Zelda'' series" | The Legend of Zelda series | |
23 | display("fakeGame")
| nil
|
shortName
shortName(code)
Returns
- Short name for franchise title used in category names. Usually the subtitle.
Examples
# | Input | Output | Result | Status |
---|---|---|---|---|
24 | shortName("LA")
| "Link's Awakening" | Link's Awakening | |
25 | shortName("la")
| "Link's Awakening" | Link's Awakening | |
26 | shortName("LANS")
| "Link's Awakening (Nintendo Switch)" | Link's Awakening (Nintendo Switch) | |
27 | shortName("LA (Cagiva)")
| "Link's Awakening (Cagiva)" | Link's Awakening (Cagiva) | |
28 | shortName("Series")
| "The Legend of Zelda Series" | The Legend of Zelda Series | |
29 | shortName("fakeGame")
| nil
|
Games
enumGames
enumGames([includeSeries])
Parameters
[includeSeries]
- If true, then
Series
is included at the very beginning of the list.
Returns
- An array of all game codes in canon order, plus a
reference
key so that it can be used for documentation and validation.
Examples
# | Input | Output | Status | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
30 | local enum = Franchise.enumGames()
return utilsTable.slice(enum, 18, 20)
| {"TMC", "TP", "TPHD"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
31 | return Franchise.enumGames().reference
| "[[Data:Franchise]]" | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
When includeSeries is true, then Series is the first item in the enum. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
32 | local enum = Franchise.enumGames(true)
return utilsTable.take(enum, 3)
| {"Series", "TLoZ", "TAoL"}
|
family
family(code)
Returns
- A grouping name used for certain non-canon games on the Main Page.
Examples
# | Input | Output | Status |
---|---|---|---|
33 | family("OoT")
| "" | |
34 | family("LCT")
| "" | |
35 | family("FPTRR")
| "Tingle" | |
36 | family("HWDE")
| "Hyrule Warriors" |
graphics
graphics(code)
Returns
- A string:
2D
or3D
.
Examples
# | Input | Output | Status |
---|---|---|---|
37 | graphics("LA")
| "2D" | |
38 | graphics("la")
| "2D" | |
39 | graphics("LANS")
| "3D" | |
40 | graphics("fake")
| nil
|
hasRemakes
hasRemakes(code)
Returns
- True if game has at least one remake, remaster, or enhanced port. Else false.
Examples
# | Input | Output | Result |
---|---|---|---|
41 | hasRemakes("LA")
| true
| |
42 | hasRemakes("la")
| true
| |
43 | hasRemakes("ST")
| false
| |
44 | hasRemakes("fakeGame")
| false
|
isRemake
isRemake(code)
Returns
- True if game is a remake, remaster, or enhanced port. Else false.
Examples
# | Input | Output | Result |
---|---|---|---|
45 | isRemake("LANS")
| true
| |
46 | isRemake("lans")
| true
| |
47 | isRemake("LA")
| false
|
remakes
remakes(code)
Returns
- List of remakes for a specific game, or a table of all remakes if no game specified
Examples
# | Input | Output | Result |
---|---|---|---|
48 | remakes("LA")
| {"LADX", "LANS"}
| |
49 | remakes("la")
| {"LADX", "LANS"}
| |
50 | remakes("ST")
| {}
| |
51 | remakes("fake")
| {}
|
Books
phraseLink
phraseLink(code)
Returns
- Formatted link to page and authors.
Examples
# | Input | Output | Result | Status | ||||
---|---|---|---|---|---|---|---|---|
52 | phraseLink("TLoZ (Ran)")
| "[[The Legend of Zelda (Ran)|''The Legend of Zelda'' manga]] by [[Maru Ran]]" | The Legend of Zelda manga by Maru Ran | |||||
53 | phraseLink("tloz (ran)")
| "[[The Legend of Zelda (Ran)|''The Legend of Zelda'' manga]] by [[Maru Ran]]" | The Legend of Zelda manga by Maru Ran | |||||
54 | phraseLink("TLoZAOV")
|
| ||||||
55 | phraseLink("fake")
| nil
|
local p = {}
local h = {}
local ListPages = require("Module:List Pages")
local utilsArg = require("Module:UtilsArg")
local utilsCargo = require("Module:UtilsCargo")
local utilsLayout = require("Module:UtilsLayout")
local utilsMarkup = require("Module:UtilsMarkup")
local utilsString = require("Module:UtilsString")
local utilsTable = require("Module:UtilsTable")
local utilsVar = require("Module:UtilsVar")
local cache = mw.loadData("Module:Franchise/Cache")
local orderCounter = utilsVar.counter("canonOrder")
-- Many templates need "Series" as if it were a game. Since it does not fit into the data model of Data:Franchise, it is manually defined here.
local series = {
page = "The Legend of Zelda (Series)",
shortName = "The Legend of Zelda Series",
logo = "File:Zelda Logo TP.png",
link = "[[The Legend of Zelda (Series)|''The Legend of Zelda'' series]]",
display = "''The Legend of Zelda'' series",
}
local CARGO = {
tables = {
Game = "Games3",
Book = "Books",
TV = "TelevisionShows",
Compilation = "Compilations",
},
fields = {
common = {
code = "String",
page = "Page",
shortName = "String",
logo = "File",
releaseDate = "Date",
canonicity = "String",
type = "String",
display = "Wikitext",
link = "Wikitext",
},
Game = {
canonOrder = "Integer",
graphics = "String",
family = "String",
remakeOf = "String",
supersededBy = "String",
},
Book = {
canonOrder = "Integer",
phraseLink = "Wikitext",
authors = "List (,) of String",
basedOn = "String",
},
TV = {
canonOrder = "Integer",
},
Compilation = {
titles = "List (,) of String"
},
}
}
CARGO.fields.Game = utilsTable.merge({}, CARGO.fields.common, CARGO.fields.Game)
CARGO.fields.Book = utilsTable.merge({}, CARGO.fields.common, CARGO.fields.Book)
CARGO.fields.TV = utilsTable.merge({}, CARGO.fields.common, CARGO.fields.TV)
CARGO.fields.Compilation = utilsTable.merge({}, CARGO.fields.common, CARGO.fields.Compilation)
local DATA = {
common = {"canonOrder", "code", "link", "display", "logo", "releaseDate", "canonicity", "type"},
Game = {"graphics", "family", "remakeOf", "supersededBy"},
Book = {"phraseLink", "authors", "basedOn"},
TV = {},
Compilation = {"titles"}
}
DATA.Game = utilsTable.concat(DATA.common, DATA.Game)
DATA.Book = utilsTable.concat(DATA.common, DATA.Book)
DATA.TV = utilsTable.concat(DATA.common, DATA.TV)
DATA.Compilation = utilsTable.concat(DATA.common, DATA.Compilation)
function p.CargoDeclare(frame)
local entryType = frame.args[1]
return utilsCargo.declare(CARGO.tables[entryType], CARGO.fields[entryType])
end
function p.CargoStore(frame)
local entryType = frame.args[1]
local args, err = utilsArg.parse(frame:getParent().args, p.Templates["Franchise/Store " .. entryType])
if err then
return utilsMarkup.categories(err.categories)
end
args = h.derive(args, entryType)
utilsVar.add("rows", args)
return utilsCargo.store(CARGO.tables[entryType], args)
end
function p.CargoPreview(frame)
local rows = utilsVar.get("rows")
for _, row in ipairs(rows) do
row.logo = utilsMarkup.link(row.logo)
end
local rowGroups = utilsTable.groupBy(rows, "entryType")
local titles = utilsLayout.table({
sortable = true,
headers = DATA.common,
rows = utilsTable.map(rows, utilsTable._toArray(DATA.common, ""))
})
local games = utilsLayout.table({
sortable = true,
headers = DATA.Game,
rows = utilsTable.map(rowGroups.Game, utilsTable._toArray(DATA.Game, ""))
})
local books = utilsLayout.table({
sortable = true,
headers = DATA.Book,
rows = utilsTable.map(rowGroups.Book, utilsTable._toArray(DATA.Book, ""))
})
local tv = utilsLayout.table({
sortable = true,
headers = DATA.TV,
rows = utilsTable.map(rowGroups.TV, utilsTable._toArray(DATA.TV, ""))
})
-- local compilations = utilsTable.table({
-- sortable = true,
-- headers = DATA.Compilation,
-- rows = utilsTable.map(rowGroups.Compilation, utilsTable._toArray(DATA.Compilation, ""))
-- })
local preview = utilsLayout.tabs({
{
label = "All Titles",
content = titles,
},
{
label = "Games",
content = games,
},
{
label = "Books",
content = books,
},
{
label = "TV Shows",
content = tv,
},
{
label = "Compilations",
content = compilations
}
})
return preview
end
function h.derive(args, type)
local derived = {}
if type == "Game" then
derived = h.deriveGameFields(args)
elseif type == "Book" then
derived = h.deriveBookFields(args)
elseif type == "TV" then
derived = h.deriveGameFields(args) -- logic is the same for TV as it is for games
elseif type == "Compilation" then
derived = h.deriveGameFields(args) -- same for compilations
end
local allArgs = utilsTable.merge({}, args, derived, {
entryType = type
})
if type ~= "Compilation" then
allArgs.canonOrder = orderCounter.increment()
end
return allArgs
end
function h.deriveGameFields(args)
return {
link = args.link or ("''[[%s|%s]]''"):format(args.page, args.shortName),
display = args.display or ("''%s''"):format(args.shortName),
}
end
function h.deriveBookFields(args)
local subtitle, display, link, phraseLink
local parens = string.find(args.shortName, "%s%([^)]+%)")
if parens then
subtitle = string.sub(args.shortName, 1, parens - 1)
local descriptor = string.sub(args.shortName, parens)
display = ("''%s''%s"):format(subtitle, descriptor)
link = ("[[%s|%s]]"):format(args.page, display)
local authors = ListPages.main(utilsString.split(args.authors))
phraseLink = ("[[%s|''%s'' %s]] by %s"):format(args.page, subtitle, args.type, authors)
else
display = ("''%s''"):format(args.shortName)
link = ("''[[%s|%s]]''"):format(args.page, args.shortName)
phraseLink = link
end
return {
display = display,
link = link,
phraseLink = phraseLink,
}
end
-- QUERIES: ALL
function p.enum(includeSeries)
if includeSeries then
local result = utilsTable.clone(cache.enum)
table.insert(result, 1, "Series")
return result
end
return cache.enum
end
function p.canonicity(code)
return h.get(code, "canonicity")
end
function p.logo(code)
return h.get(code, "logo")
end
function p.link(code)
return h.get(code, "link")
end
function p.display(code)
return h.get(code, "display")
end
function p.type(code)
return h.get(code, "type")
end
function p.ShortName(frame)
local args, err = utilsArg.parse(frame.args, {
params = {
[1] = {
name = "code",
enum = p.enum(true),
}
}
})
if err then
return utilsMarkup.categories(err.categories)
end
return p.shortName(args.code)
end
function p.shortName(code)
return h.get(code, "shortName")
end
-- QUERIES: GAMES
function p.enumGames(includeSeries)
if includeSeries then
return utilsTable.concat({"Series"}, cache.enumGames)
end
return cache.enumGames
end
function p.family(code)
return h.get(code, "family")
end
function p.graphics(code)
return h.get(code, "graphics")
end
function p.hasRemakes(code)
return utilsTable.hasKey(cache.remakes, string.lower(code))
end
function p.isRemake(code)
return p.type(code) == "remake"
end
function p.remakes(code)
return utilsTable.clone(cache.remakes[string.lower(code)]) or {}
end
-- QUERIES: BOOKS
function p.phraseLink(code)
return h.get(code, "phraseLink")
end
function h.get(code, prop)
code = string.lower(code)
if code == "series" then
return series[prop]
end
local title = cache.titlesByCode[code]
return title and title[prop]
end
p.Schemas = {
enum = {
includeSeries = {
type = "boolean",
desc = "If true, then <code>Series</code> is included at the very beginning of the list.",
},
},
enumGames = {
includeSeries = {
type = "boolean",
desc = "If true, then <code>Series</code> is included at the very beginning of the list.",
},
}
}
p.Templates = {
["Franchise/Store Game"] = {
purpose = "Each instance of this template describes an entry in ''The Legend of Zelda'' franchise (or a game related to the franchise).",
storesData = "Data:Franchise",
format = "block",
indent = 1,
boilerplate = {
before = "<!--\n-->",
},
paramOrder = {"code", "page", "shortName", "logo", "releaseDate", "canonicity", "type", "link", "display", "graphics", "family", "remakeOf", "supersededBy"},
params = {
code = {
required = true,
type = "string",
desc = "A string that uniquely identifies the game. Usually an initialism of its subtitle.",
trim = true,
nilIfEmpty = true,
},
page = {
required = true,
type = "wiki-page-name",
desc = "The wiki page for the game.",
trim = true,
nilIfEmpty = true,
},
shortName = {
required = true,
type = "string",
desc = "The name for the game used in categories such as [[:Category:Items in Link's Awakening (Nintendo Switch)]]. Usually the game's subtitle, possibly with a parenthetical disambiguator.",
trim = true,
nilIfEmpty = true,
},
logo = {
required = true,
type = "wiki-file-name",
desc = "Filename for the game's logo. If no such logo is available, use the logo of the associated franchise, or the game's box art.",
trim = true,
nilIfEmpty = true,
},
releaseDate = {
type = "date",
desc = "The date of the game's initial release in North America, in YYYY-MM-DD format. Leave blank for future games. If not released in North America, use the earliest release date of any region (most likely Japan).",
trim = true,
nilIfEmpty = true,
},
canonicity = {
-- required = true,
type = "string",
enum = {"canon", "ambiguous", "non-canon"},
desc = "The title's [[Guidelines:Canon|canon status]].",
trim = true,
nilIfEmpty = true,
},
type = {
type = "string",
enum = {"main", "remake", "spin-off"},
desc = "Leave blank for cross-overs and cameos. Used to group games on the [[Main Page]].",
trim = true,
nilIfEmpty = true,
},
link = {
type = "content",
desc = "Wikitext used when linking the game in articles. By default, this is derived from <code>page</code> and <code>shortName</code>. Should be left blank unless the game's link is a special case (see examples).",
trim = true,
nilIfEmpty = true,
},
display = {
type = "content",
desc = "Wikitext used when mentioning the game in articles, sans link. By default, this is derived from <code>shortName</code>. Should be left blank unless the game's display text is a special case (see examples).",
trim = true,
nilIfEmpty = true,
},
graphics = {
type = "string",
enum = {"2D", "3D", "4D"},
desc = 'Indicates whether the game is 2D or 3D. Used by [[Module:File]] for image handling, among other things. For live-action games, put down "4D".', -- TODO: more specific
trim = true,
nilIfEmpty = true,
},
family = {
type = "string",
desc = "Identifies the game as being part of a sub-group in the franchise. Leave blank for canon games. This is used to group certain games on the [[Main Page]]",
trim = true,
nilIfEmpty = true,
},
remakeOf = {
--enum = p.enum(),
type = "string",
desc = "The code of the game that this game is a remake of, if any.",
trim = true,
nilIfEmpty = true,
},
supersededBy = {
--enum = p.enum(),
type = "string",
desc = "The name of the game that supersedes this one in terms of [[Guidelines:Canon|canon]].",
trim = true,
nilIfEmpty = true,
},
},
examples = {
{
code = "LA",
page = "The Legend of Zelda: Link's Awakening",
shortName = "Link's Awakening",
logo = "File:LA English Logo 2.png",
releaseDate = "1993-06-06",
canonicity = "canon",
type = "main",
link = "",
display = "",
graphics = "2D",
family = "",
remakeOf = "",
supersededBy = "LANS",
},
{
code = "LANS",
page = "The Legend of Zelda: Link's Awakening (Nintendo Switch)",
shortName = "Link's Awakening (Nintendo Switch)",
logo = "File:LANS English Logo.png",
releaseDate = "2019-09-20",
canonicity = "canon",
type = "remake",
link = "''[[The Legend of Zelda: Link's Awakening (Nintendo Switch)|Link's Awakening]]'' for Nintendo Switch.",
display = "''Link's Awakening'' for Nintendo Switch",
graphics = "3D",
family = "",
remakeOf = "LA",
supersededBy = "",
},
{
code = "FPTRR",
page = "Freshly-Picked Tingle's Rosy Rupeeland",
shortName = "Freshly-Picked Tingle's Rosy Rupeeland",
logo = "File:TRRLogo.png",
releaseDate = "2006-09-02",
canonicity = "ambiguous",
type = "spin-off",
link = "",
display = "",
graphics = "2D",
family = "Tingle",
remakeOf = "",
supersededBy = "",
},
{
code = "Skyrim",
page = "The Elder Scrolls V: Skyrim",
shortName = "Skyrim",
logo = "File:Skyrim Logo.png",
releaseDate = "2017-11-17",
canonicity = "non-canon",
type = "",
link = "",
display = "",
graphics = "3D",
family = "",
remakeOf = "",
supersededBy = "",
},
},
},
["Franchise/Store Book"] = {
purpose = "Each instance of this template describes a ''The Legend of Zelda'' book, comic, or manga.",
storesData = "Data:Franchise",
format = "block",
indent = 1,
boilerplate = {
before = "<!--\n-->",
},
paramOrder = {"code", "page", "shortName", "logo", "releaseDate", "canonicity", "type", "link", "display", "phraseLink", "authors", "illustrators", "basedOn"},
params = {
code = {
required = true,
type = "string",
desc = "A string that uniquely identifies the book. Usually an initialism of its subtitle.",
trim = true,
nilIfEmpty = true,
},
page = {
required = true,
type = "wiki-page-name",
desc = "The wiki page for the book, comic, or manga.",
trim = true,
nilIfEmpty = true,
},
shortName = {
required = true,
type = "string",
desc = "The name for the book used in categories such as [[:Characters in Majora's Mask (Himekawa)]]. Usually the book's subtitle, possibly with a parenthetical disambiguator of the primary author's last name.",
trim = true,
nilIfEmpty = true,
},
logo = {
required = true,
type = "wiki-file-name",
desc = "Filename for the logo of the book's publisher. If no such logo is available, use the book's cover or an illustration in the front matter.",
trim = true,
nilIfEmpty = true,
},
releaseDate = {
type = "date",
desc = "The date of the book's initial release in North America, in YYYY-MM-DD format. Leave blank for unreleased books. If not released in North America, use the earliest release date of any region (most likely Japan).",
trim = true,
nilIfEmpty = true,
},
canonicity = {
required = true,
type = "string",
enum = {"canon", "ambiguous", "non-canon"},
desc = "The title's [[Guidelines:Canon|canon status]].",
trim = true,
nilIfEmpty = true,
},
type = {
type = "string",
enum = {"book", "comic", "manga"},
desc = "Identifies the type of book.",
trim = true,
nilIfEmpty = true,
},
link = {
type = "content",
desc = "Wikitext used when linking the book in article infoboxes (use <code>phraseLink</code> for article content). By default, this is derived from <code>page</code> and <code>shortName</code>. Should be left blank unless the link is a special case.",
trim = true,
nilIfEmpty = true,
},
display = {
type = "content",
desc = "Wikitext used when mentioning the book in articles, sans link. By default, this is derived from <code>shortName</code>. Should be left blank unless the display text is a special case.",
trim = true,
nilIfEmpty = true,
},
phraseLink = {
type = "content",
desc = "Wikitext to be used when linking to a book. By default, this is derived from <code>page</code>, <code>shortName</code> and <code>authors</code>. Should be left blank unless the link is a special case.",
trim = true,
nilIfEmpty = true,
},
authors = {
type = "string",
desc = "Comma-separated list of the book's authors.",
trim = true,
nilIfEmpty = true,
},
illustrators = {
type = "string",
desc = "Comma-separted list of the book's illustrators.",
trim = true,
nilIfEmpty = true,
},
basedOn = {
type = "string",
--enum = p.enum(),
desc = "The game that this book is based on.",
trim = true,
nilIfEmpty = true,
},
},
examples = {
{
code = "OoT (Himekawa)",
page = "The Legend of Zelda: Ocarina of Time (Himekawa)",
shortName = "Ocarina of Time (Himekawa)",
logo = "File:Viz Media Logo.png",
releaseDate = "2008-10-08",
canonicity = "non-canon",
type = "manga",
link = "",
display = "",
phraseLink = "",
authors = "Akira Himekawa",
illustrators = "Akira Himekawa",
basedOn = "OoT",
},
{
code = "LatPoD",
page = "Link and the Portal of Doom",
shortName = "Link and the Portal of Doom",
logo = "File:Scholastic Logo.png",
releaseDate = "2006",
canonicity = "non-canon",
type = "book",
link = "",
display = "",
phraseLink = "",
authors = "Tracey West",
illustrators = "",
basedOn = "",
}
}
},
["Franchise/Store TV"] = {
purpose = "Each instance of this template describes a ''The Legend of Zelda''-related TV show.",
storesData = "Data:Franchise",
format = "block",
indent = 1,
boilerplate = {
before = "<!--\n-->",
},
paramOrder = {"code", "page", "shortName", "logo", "releaseDate", "canonicity", "type", "link", "display"},
params = {
code = {
required = true,
type = "string",
desc = "A string that uniquely identifies the TV series. Usually an initialism of its title.",
trim = true,
nilIfEmpty = true,
},
page = {
required = true,
type = "wiki-page-name",
desc = "The wiki page for the TV series.",
trim = true,
nilIfEmpty = true,
},
shortName = {
required = true,
type = "string",
desc = "The name for the TV series used in categories such as [[:Category:The Legend of Zelda TV Series Screenshots]].",
trim = true,
nilIfEmpty = true,
},
logo = {
required = true,
type = "wiki-file-name",
desc = "Filename for the TV series' logo. If no such logo is available, use the series' title card.",
trim = true,
nilIfEmpty = true,
},
releaseDate = {
type = "date",
desc = "The date of the TV series' first air date in North America, in YYYY-MM-DD format. If not released in North America, use the earliest release date of any region (most likely Japan).",
trim = true,
nilIfEmpty = true,
},
canonicity = {
required = true,
type = "string",
enum = {"non-canon"},
desc = "The title's [[Guidelines:Canon|canon status]].",
trim = true,
nilIfEmpty = true,
},
type = {
type = "string",
enum = {"animated"},
desc = "Identifies the type of TV series .",
trim = true,
nilIfEmpty = true,
},
link = {
type = "content",
desc = "Wikitext used when linking the TV series in articles. By default, this is derived from <code>page</code> and <code>shortName</code>. Should be left blank unless the link is a special case.",
trim = true,
nilIfEmpty = true,
},
display = {
type = "content",
desc = "Wikitext used when mentioning the TV series in articles, sans link. By default, this is derived from <code>shortName</code>. Should be left blank unless the display text is a special case.",
trim = true,
nilIfEmpty = true,
},
},
examples = {
{
code = "TLoZ (TV Series)",
page = "The Legend of Zelda (TV Series)",
shortName = "The Legend of Zelda TV Series",
logo = "File:TLoZ TV Series Logo.png",
releaseDate= "1989-09-08",
canonicity = "non-canon",
type = "animated",
link = "[[The Legend of Zelda (TV Series)|''The Legend of Zelda'' TV series]]",
display = "''The Legend of Zelda'' TV series",
},
{
code = "TMoL",
page = "The Legend of Zelda: The Misadventures of Link",
shortName = "The Misadventures of Link",
logo = "File:Misadventures Link logo2.png",
releaseDate = "2013-11-01",
canonicity = "non-canon",
type = "animated",
link = "",
display = "",
},
}
},
["Franchise/Store Compilation"] = {
purpose = "Describes ''Zelda'' publications that are not franchise entires per se, but rather compilations of information from other franchise entries.",
storesData = "Data:Franchise",
format = "block",
indent = 1,
boilerplate = {
before = "<!--\n-->",
},
paramOrder = {"code", "page", "shortName", "logo", "releaseDate", "canonicity", "link", "display", "titles"},
params = {
code = {
required = true,
type = "string",
desc = "A string that uniquely identifies the compilation. Usually an initialism of its subtitle.",
trim = true,
nilIfEmpty = true,
},
page = {
required = true,
type = "wiki-page-name",
desc = "The wiki page for the compilation.",
trim = true,
nilIfEmpty = true,
},
shortName = {
required = true,
type = "string",
desc = "The name for the compilation used in article text. Generally its subtitle.",
trim = true,
nilIfEmpty = true,
},
logo = {
required = true,
type = "wiki-file-name",
desc = "Filename for the compilation's logo. If no such logo is available, use its cover.",
trim = true,
nilIfEmpty = true,
},
releaseDate = {
type = "date",
desc = "The date of the compilation's first publication in North America, in YYYY-MM-DD format. If not released in North America, use the earliest release date of any region (most likely Japan).",
trim = true,
nilIfEmpty = true,
},
canonicity = {
required = true,
type = "string",
enum = {"canon", "ambiguous", "non-canon"},
desc = "The title's [[Guidelines:Canon|canon status]].",
trim = true,
nilIfEmpty = true,
},
link = {
type = "content",
desc = "Wikitext used when linking the compilation in articles. By default, this is derived from <code>page</code> and <code>shortName</code>. Should be left blank unless the link is a special case.",
trim = true,
nilIfEmpty = true,
},
display = {
type = "content",
desc = "Wikitext used when mentioning the compilation in articles, sans link. By default, this is derived from <code>shortName</code>. Should be left blank unless the display text is a special case.",
trim = true,
nilIfEmpty = true,
},
titles = {
required = true,
type = "string",
desc = "Comma-separated list of franchise entries covered in the compilation.",
split = true,
trim = true,
nilIfEmpty = true,
}
},
examples = {
{
code = "E",
page = "The Legend of Zelda: Encyclopedia",
shortName = "Encyclopedia",
logo = "File:The Legend of Zelda Encyclopedia Cover.png",
releaseDate= "2018-06-19",
canonicity = "canon",
link = "",
display = "",
titles = "TLoZ, TAoL, ALttP, ..., SS, ALBW, TFH",
}
}
}
}
p.Documentation = {
sections = {
{
heading = "All Media",
section = {
enum = {
desc = "See also {{Sect|enumGames}}.",
params = {"includeSeries"},
returns = "An array of all codes in [[Guidelines:Main#Canon_Order|canon order]], plus a <code>reference</code> key so that it can be used for [[Module:Documentation|documentation]] and [[Module:UtilsArg|validation]].",
cases = {
outputOnly = true,
{
snippet = 1,
expect = {"TLoZ", "TAoL", "ALttP", "LA", "LADX", "LANS", "OoT", "OoT3D", "MM", "MM3D"},
},
{
snippet = 2,
expect = "[[Data:Franchise]]",
},
{
snippet = "IncludeSeries",
desc = "When <code>includeSeries</code> is true, then <code>Series</code> is the first item in the enum.",
expect = {"Series", "TLoZ", "TAoL"},
}
},
},
shortName = {
params = {"code"},
returns = "Short name for franchise title used in [[:Category:Content by Title|category names]]. Usually the subtitle.",
cases = {
{
args = {"LA"},
expect = "Link's Awakening",
},
{
args = {"la"},
expect = "Link's Awakening"
},
{
args = {"LANS"},
expect = "Link's Awakening (Nintendo Switch)",
},
{
args = {"LA (Cagiva)"},
expect = "Link's Awakening (Cagiva)",
},
{
args = {"Series"},
expect = "The Legend of Zelda Series"
},
{
args = {"fakeGame"},
expect = nil,
},
}
},
link = {
params = {"code"},
returns = "Formatted link used in infoboxes and so on.",
cases = {
{
args = {"LA"},
expect = "''[[The Legend of Zelda: Link's Awakening|Link's Awakening]]''",
},
{
args = {"la"},
expect = "''[[The Legend of Zelda: Link's Awakening|Link's Awakening]]''",
},
{
args = {"LADX"},
expect = "''[[The Legend of Zelda: Link's Awakening DX|Link's Awakening DX]]''",
},
{
args = {"LANS"},
expect = "''[[The Legend of Zelda: Link's Awakening (Nintendo Switch)|Link's Awakening]]'' for Nintendo Switch",
},
{
desc = "For books, comics and manga, see also {{Sect|phraseLink}}.",
args = {"LA (Cagiva)"},
expect = "[[The Legend of Zelda: Link's Awakening (Cagiva)|''Link's Awakening'' (Cagiva)]]",
},
{
args = {"fakeGame"},
expect = nil,
},
}
},
display = {
params = {"code"},
returns = "Formatted text for the title",
cases = {
{
args = {"LA"},
expect = "''Link's Awakening''",
},
{
args = {"la"},
expect = "''Link's Awakening''",
},
{
args = {"LANS"},
expect = "''Link's Awakening'' for Nintendo Switch",
},
{
args = {"Series"},
expect = "''The Legend of Zelda'' series"
},
{
args = {"fakeGame"},
expect = nil,
},
}
},
logo = {
params = {"code"},
returns = "Filename for the title's logo.",
cases = {
{
args = {"LANS"},
expect = "File:LANS English Logo.png",
},
{
args = {"lans"},
expect = "File:LANS English Logo.png"
},
{
args = {"Series"},
expect = "File:Zelda Logo TP.png"
},
{
args = {"fakeGame"},
expect = nil
}
}
},
canonicity = {
params = {"code"},
returns = "A string: <code>canon</code>, <code>ambiguous</code>, or <code>non-canon</code>.",
cases = {
outputOnly = true,
{
args = {"LA"},
expect = "canon",
},
{
args = {"la"},
expect = "canon",
},
{
args = {"CoH"},
expect = "ambiguous",
},
{
args = {"LA (Cagiva)"},
expect = "non-canon",
},
{
args = {"fake"},
expect = nil,
}
},
},
},
},
{
heading = "Games",
section = {
enumGames = {
params = {"includeSeries"},
returns = "An array of all game codes in [[Guidelines:Main#Canon_Order|canon order]], plus a <code>reference</code> key so that it can be used for [[Module:Documentation|documentation]] and [[Module:UtilsArg|validation]].",
cases = {
outputOnly = true,
{
snippet = "1",
expect = {"TMC", "TP", "TPHD"},
},
{
snippet = "2",
expect = "[[Data:Franchise]]",
},
{
snippet = "IncludeSeries",
desc = "When <code>includeSeries</code> is true, then <code>Series</code> is the first item in the enum.",
expect = {"Series", "TLoZ", "TAoL"},
},
},
},
family = {
params = {"code"},
returns = "A grouping name used for certain non-canon games on the [[Main Page]].",
cases = {
outputOnly = true,
{
args = {"OoT"},
expect = "",
},
{
args = {"LCT"},
expect = "",
},
{
args = {"FPTRR"},
expect = "Tingle",
},
{
args = {"HWDE"},
expect = "Hyrule Warriors",
},
},
},
graphics = {
params = {"code"},
returns = "A string: <code>2D</code> or <code>3D</code>.",
cases = {
outputOnly = true,
{
args = {"LA"},
expect = "2D",
},
{
args = {"la"},
expect = "2D",
},
{
args = {"LANS"},
expect = "3D",
},
{
args = {"fake"},
expect = nil,
},
},
},
hasRemakes = {
params = {"code"},
returns = "True if game has at least one remake, remaster, or enhanced port. Else false.",
cases = {
{
args = {"LA"},
expect = true,
},
{
args = {"la"},
expect = true,
},
{
args = {"ST"},
expect = false
},
{
args = {"fakeGame"},
expect = false,
},
},
},
isRemake = {
params = {"code"},
returns = "True if game is a remake, remaster, or enhanced port. Else false.",
cases = {
{
args = {"LANS"},
expect = true,
},
{
args = {"lans"},
expect = true,
},
{
args = {"LA"},
expect = false,
},
},
},
remakes = {
params = {"code"},
returns = "List of remakes for a specific game, or a table of all remakes if no game specified",
cases = {
{
args = {"LA"},
expect = {"LADX", "LANS"},
},
{
args = {"la"},
expect = {"LADX", "LANS"},
},
{
args = {"ST"},
expect = {}
},
{
args = {"fake"},
expect = {},
},
},
},
},
},
{
heading = "Books",
section = {
phraseLink = {
params = {"code"},
returns = "Formatted link to page and authors.",
cases = {
{
args = {"TLoZ (Ran)"},
expect = "[[The Legend of Zelda (Ran)|''The Legend of Zelda'' manga]] by [[Maru Ran]]",
},
{
args = {"tloz (ran)"},
expect = "[[The Legend of Zelda (Ran)|''The Legend of Zelda'' manga]] by [[Maru Ran]]",
},
{
args = {"TLoZAOV"},
expect = "''[[‟The Legend of Zelda„ An Original Version|‟The Legend of Zelda„ An Original Version]]''",
},
{
args = {"fake"},
expect = nil,
},
},
},
},
},
},
}
return p