Editing Module:Test/doc
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | __NOEDITSECTION__ | + | __NOTOC__ __NOEDITSECTION__ |
'''This module is used for development.''' | '''This module is used for development.''' | ||
Line 13: | Line 13: | ||
=== query === | === query === | ||
− | < | + | <hr> |
The work-horse. Output varies based on use: | The work-horse. Output varies based on use: | ||
− | |||
: If simple values are queried it will return them. | : If simple values are queried it will return them. | ||
: If lists are queried it will return nothing but call <code><nowiki>{{#vardefine}}</nowiki></code> on all the simple values within it. What got defined can be seen in the page's log. | : If lists are queried it will return nothing but call <code><nowiki>{{#vardefine}}</nowiki></code> on all the simple values within it. What got defined can be seen in the page's log. | ||
− | Named parameters: | + | <pre><nowiki>{{#invoke:Test|query|<def ID>[|...|][|tag|][|sibling=...]}}</nowiki></pre> |
+ | |||
+ | '''Named parameters:''' | ||
− | + | <code><def ID></code> | |
− | + | : This parameter identifies the Def so it is mandatory. It can take two forms: | |
− | + | : <code>defName=<defName></code> | |
− | + | :: <code><defName></code> <small>''(case sensitive)''</small> should be replaced with the actual defName of a Def. | |
− | + | : <code>label=<label></code> | |
− | + | :: <code><label></code> <small>''(case insensitive)''</small> should be replaced with the actual label of a Def. | |
− | + | <code>[sibling=...]</code> <small>''(optional)''</small> <small>''(case sensitive)''</small> | |
− | + | : Allows querying for something if we know its sibling's value (works only for values at the moment). | |
− | Anonymous parameters: | + | '''Anonymous parameters:''' |
− | + | <code>[|...|]</code> <small>''(optional)''</small> <small>''(case sensitive)''</small> | |
− | + | : Anonymous paramaters before the last one (<code>[tag]</code>) are here to help uniquely identify it. If the <code>[tag]</code> is already unique within a Def tree, then these additional parameters are not needed. | |
− | + | <code>[|tag|]</code> <small>''(optional)''</small> <small>''(case sensitive)''</small> | |
− | + | : The final anonymous parameter defines what is to be queried. | |
=== count === | === count === | ||
− | <pre><nowiki>{{#invoke:Test|count|<def ID>[|...|][ | + | <hr> |
+ | |||
+ | <pre><nowiki>{{#invoke:Test|count|<def ID>|[...|...|...]|[tag]|[sibling=...]}}</nowiki></pre> | ||
Parameters are the same as for <code>query</code>. It's basically a wrapped up query that behaves a bit differently. | Parameters are the same as for <code>query</code>. It's basically a wrapped up query that behaves a bit differently. | ||
Line 55: | Line 58: | ||
<code><nowiki>{{#invoke:Test|query|label=desert}}</nowiki></code> | <code><nowiki>{{#invoke:Test|query|label=desert}}</nowiki></code> | ||
− | + | {{#invoke:Test|query|label=desert}} | |
− | + | ''(check the log)'' | |
− | |||
− | |||
=== Retrieve a simple value === | === Retrieve a simple value === | ||
Line 113: | Line 114: | ||
<code>{{#invoke:Test|query|label=guinea pig|minAge|sibling=AnimalAdult}}</code> | <code>{{#invoke:Test|query|label=guinea pig|minAge|sibling=AnimalAdult}}</code> | ||
− | |||
− | |||
− |