Module:ArgsTNT/doc
This is the documentation page for Module:ArgsTNT
Designed to create multilingual templates. Functions using Module:TNTTools and Module:SimpleArgs
Frame functions[edit source]
The name functions with suffix P take the name of the table from the template name. Otherwise you must use the functions with a suffix T that needs the TableN or the table name.
Value of an item in the table[edit source]
Where Id is the element's identifier in the table.
{{#invoke:ArgsTNT|StrP|Id}}
{{#invoke:ArgsTNT|StrT|TableN|Id}}
Creating a link to an article. If Always is true it will create the link even if the article does not exist.
{{#invoke:ArgsTNT|StrLnkP|Id|Always}}
{{#invoke:ArgsTNT|StrLnkT|TableN|Id|Always}}
Existence of parameters[edit source]
On Id1, etc. They are a variable number of parameter identifiers. Returns 1 if it finds Any or if there are All.
{{#invoke:ArgsTNT|ExistsAnyP|Id1|Id2...}}
{{#invoke:ArgsTNT|ExistsAnyT|TableN|Id1|Id2...}}
{{#invoke:ArgsTNT|ExistsAllP|Id1|Id2...}}
{{#invoke:ArgsTNT|ExistsAllT|TableN|Id1|Id2...}}
Parameter values[edit source]
- When the function has a R as prefix it is that the values are required, in case of being omitted, an error message will be presented.
- Val corresponds to a value or assignment using , where n is the parameter number.
- Id is the parameter identifier in the table. The values returned by the table identifier can be one or more (then separated by '|').
- Default is the value that will be assigned if it is defined.
- OKEmpty indicates that it is accepted without value.
- The mark * indicates that the parameter is optional.
Strings[edit source]
{{#invoke:ArgsTNT|Str_Par|Val|Default*}}
{{#invoke:ArgsTNT|Str_ParP|Id|Default*}}
{{#invoke:ArgsTNT|Str_ParT|TableN|Id|Default*}}
{{#invoke:ArgsTNT|RStr_Par|Val|Default*|OKEmpty*}}
{{#invoke:ArgsTNT|RStr_ParP|Id|Default*|OKEmpty*}}
{{#invoke:ArgsTNT|RStr_ParT|TableN|Id|OKEmpty*}}
Checking strings[edit source]
- PossibleValsId is the identifier in the table of possible values separated by '|'.
- CaseSens if is case-sensitive.
{{#invoke:ArgsTNT|StrChkTab_Par_P|Val|PossibleValsId|CaseSens*|Default*}}
{{#invoke:ArgsTNT|StrChkTab_Par_T|TableN|Val|PossibleValsId|CaseSens*|Default*}}
{{#invoke:ArgsTNT|StrChkTab_ParP|Id|PossibleValsId|CaseSens*|Default*}}
{{#invoke:ArgsTNT|StrChkTab_ParT|TableN|Id|PossibleValsId|CaseSens*|Default*}}
{{#invoke:ArgsTNT|RStrChkTab_Par_P|Val|PossibleValsId|CaseSens*|OKEmpty*}}
{{#invoke:ArgsTNT|RStrChkTab_Par_T|TableN|Val|PossibleValsId|CaseSens*|OKEmpty*}}
{{#invoke:ArgsTNT|RStrChkTab_ParP|Id|PossibleValsId|CaseSens*|OKEmpty*}}
{{#invoke:ArgsTNT|RStrChkTab_ParT|TableN|Id|PossibleValsId|CaseSens*|OKEmpty*}}
Numbers[edit source]
- LimInf and LimSup indicate the minimum and maximum limits for the value of the parameter.
Of any type:
{{#invoke:ArgsTNT|Num_Par|Val|Default*|LimInf*|LimSup*}}
{{#invoke:ArgsTNT|Num_ParP|Id|Default*|LimInf*|LimSup*}}
{{#invoke:ArgsTNT|Num_ParT|TableN|Id|Default*|LimInf*|LimSup*}}
{{#invoke:ArgsTNT|RNum_Par|Val|OKEmpty*|LimInf*|LimSup*}}
{{#invoke:ArgsTNT|RNum_ParP|Id|OKEmpty*|LimInf*|LimSup*}}
{{#invoke:ArgsTNT|RNum_ParT|TableN|Id|OKEmpty*|LimInf*|LimSup*}}
Integers:
{{#invoke:ArgsTNT|Int_Par|Val|Default*|LimInf*|LimSup*}}
{{#invoke:ArgsTNT|Int_ParP|Id|Default*|LimInf*|LimSup*}}
{{#invoke:ArgsTNT|Int_ParT|TableN|Id|Default*|LimInf*|LimSup*}}
{{#invoke:ArgsTNT|RInt_Par|Val|OKEmpty*|LimInf*|LimSup*}}
{{#invoke:ArgsTNT|RInt_ParP|Id|OKEmpty*|LimInf*|LimSup*}}
{{#invoke:ArgsTNT|RInt_ParT|TableN|Id|OKEmpty*|LimInf*|LimSup*}}
Booleans[edit source]
They return a 1 if it is true or 0 if it is false, with the values:
- True: Lua error in Module:TNT at line 157: attempt to index field 'data' (a nil value).
- False: Lua error in Module:TNT at line 157: attempt to index field 'data' (a nil value).
Functions:
{{#invoke:ArgsTNT|Bool_Par|Val|Default*}}
{{#invoke:ArgsTNT|Bool_ParP|Id|Default*}}
{{#invoke:ArgsTNT|Bool_ParT|TableN|Id|Default*}}
{{#invoke:ArgsTNT|RBool_Par|Val|OKEmpty*}}
{{#invoke:ArgsTNT|RBool_ParP|Id|OKEmpty*}}
{{#invoke:ArgsTNT|RBool_ParT|TableN|Id|OKEmpty*}}
Searching string[edit source]
Boolean[edit source]
- Wd is the word or phrase to look for. Finding it returns a 1, but a 0.
- CaseSens if is case-sensitive.
{{#invoke:ArgsTNT|FoundStrBoolP|Wd|CaseSens|Id}}
{{#invoke:ArgsTNT|FoundStrBoolT|TableN|Wd|CaseSens|Id}}
Index[edit source]
Return the index. If he found Wd in Id1 returns a 1, if he found it in Id2 returns a 2 ... If he does not find Wd returns a 0.
{{#invoke:ArgsTNT|StrIdxChkTabP|Wd|CaseSens|Id1|Id2...}}
{{#invoke:ArgsTNT|StrIdxChkTabT|TableN|Wd|CaseSens|Id1|Id2...}}
Return an error message if it does not find Wd:
{{#invoke:ArgsTNT|StrIdxChkTabEP|Wd|CaseSens|Id1|Id2...}}
{{#invoke:ArgsTNT|StrIdxChkTabET|TableN|Wd|CaseSens|Id1|Id2...}}
Template documentation[edit source]
They functions are for use on the documentation page of the template.
These functions create a link to the table (in commons):
{{#invoke:ArgsTNT|LnkTNTTabP}}
{{#invoke:ArgsTNT|LnkTNTTabT|TableN}}
It shows the string from a table item, when it takes the name of the template (otherwise StrT must be used).
{{#invoke:ArgsTNT|StrNoEnd|Id}}
Examples[edit source]
External links[edit source]
- Module:ArgsTNT/doc at Wikipedia, the free Terran-based encyclopedia that anyone can edit.