Difference between revisions of "Template:FunctionDeclaration"
Line 1: | Line 1: | ||
− | <includeonly | + | <includeonly>{{ |
− | + | #if: {{data|{{{name}}}|function{{{func}}}.return_type}} | |
− | | | + | | <kbd><b>{{type|{{data|{{{name}}}|function{{{func}}}.return_type}}}} [[{{data|{{{name}}}|name}}]]({{ |
− | + | #if: {{data|{{{name}}}|function{{{func}}}.param1.type}} | |
− | + | | {{param2|name={{{name}}}|func={{{func}}}|param=1}}}}{{ | |
− | }}{{ | + | #if: {{data|{{{name}}}|function{{{func}}}.param2.type}} |
− | + | |, {{param2|name={{{name}}}|func={{{func}}}|param=2}}}}{{ | |
− | + | #if: {{data|{{{name}}}|function{{{func}}}.param3.type}} | |
− | + | |, {{param2|name={{{name}}}|func={{{func}}}|param=3}}}}{{ | |
− | + | #if: {{data|{{{name}}}|function{{{func}}}.param4.type}} | |
− | }}{{ | + | |, {{param2|name={{{name}}}|func={{{func}}}|param=4}}}}{{ |
− | + | #if: {{data|{{{name}}}|function{{{func}}}.param5.type}} | |
− | + | |, {{param2|name={{{name}}}|func={{{func}}}|param=5}}}}{{ | |
− | + | #if: {{data|{{{name}}}|function{{{func}}}.param1.type}} | |
− | + | | }})</b></kbd> | |
− | + | | {{error|Invalid function number (func = "{{{func|}}}") in Template:FunctionDeclaration}}}}</includeonly><noinclude> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | }} | ||
<templatedata> | <templatedata> | ||
{ | { | ||
− | "description": "Displays an ASH function's declaration. This is meant to be transcluded by other templates, rather than | + | "description": "Displays an ASH function's declaration. This is meant to be transcluded by other templates, rather than regular pages.", |
"params": { | "params": { | ||
"name": { | "name": { | ||
− | "label": "Function name", | + | "label": "Function page name", |
− | "description": "Name of | + | "description": "Name of a function page. '''This must be a data page.'''", |
− | + | "type": "wiki-page-name", | |
− | + | "required": true | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | "type": " | ||
− | |||
− | |||
− | |||
− | |||
− | " | ||
− | |||
}, | }, | ||
− | " | + | "func": { |
− | "label": " | + | "label": "Overloaded function number", |
− | "description": " | + | "description": "A function page may describe multiple overloaded functions under the same name. This parameter allows you to select one. Allowed values are 1-5, inclusive.", |
− | "type": " | + | "type": "number", |
− | " | + | "required": true |
}, | }, | ||
− | " | + | "format": { |
− | "label": " | + | "label": "Rendering format", |
− | "description": " | + | "description": "\"\" (empty string) = show everything, \"signature\" = only show parameter types (i.e. function signature). Default value is empty string (show everything).", |
"type": "line" | "type": "line" | ||
} | } | ||
Line 71: | Line 42: | ||
==Examples== | ==Examples== | ||
− | + | <pre>{{User:Philmasterplus/FunctionDeclaration|name=User:Philmasterplus/Sandbox|func=1}}</pre> | |
− | <pre>{{User:Philmasterplus/FunctionDeclaration | ||
− | |name= | ||
− | |||
− | |||
− | |||
− | |||
− | | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | }}</pre> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | {{User:Philmasterplus/FunctionDeclaration|name=User:Philmasterplus/Sandbox|func=1}} | |
− | |||
− | |name= | ||
− | |||
− | |||
− | |||
− | | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | }} | ||
− | {{User:Philmasterplus/FunctionDeclaration | + | <pre>{{User:Philmasterplus/FunctionDeclaration|name=User:Philmasterplus/Sandbox|func=2}}</pre> |
− | |name= | ||
− | | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | }} | ||
− | + | {{User:Philmasterplus/FunctionDeclaration|name=User:Philmasterplus/Sandbox|func=2}} | |
− | |||
− | |name= | ||
− | | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | }} | ||
− | {{User:Philmasterplus/FunctionDeclaration | + | <pre>{{User:Philmasterplus/FunctionDeclaration|name=User:Philmasterplus/Sandbox|func=4}}</pre> |
− | |name= | ||
− | | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | }} | ||
− | + | {{User:Philmasterplus/FunctionDeclaration|name=User:Philmasterplus/Sandbox|func=4}} | |
− | |||
− | |name= | ||
− | |||
− | |||
− | |||
− | | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | }} | ||
− | {{User:Philmasterplus/FunctionDeclaration | + | <pre>{{User:Philmasterplus/FunctionDeclaration|name=User:Philmasterplus/Sandbox|func=0}}</pre> |
− | |name= | ||
− | |||
− | |||
− | |||
− | | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | }} | ||
− | + | {{User:Philmasterplus/FunctionDeclaration|name=User:Philmasterplus/Sandbox|func=0}} | |
− | |||
− | |name= | ||
− | | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | }} | ||
− | {{User:Philmasterplus/FunctionDeclaration | + | <pre>{{User:Philmasterplus/FunctionDeclaration|name=User:Philmasterplus/Sandbox}}</pre> |
− | |name= | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | }} | ||
+ | {{User:Philmasterplus/FunctionDeclaration|name=User:Philmasterplus/Sandbox}} | ||
</noinclude> | </noinclude> |
Revision as of 23:08, 18 December 2020
Displays an ASH function's declaration. This is meant to be transcluded by other templates, rather than regular pages.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Function page name | name | Name of a function page. '''This must be a data page.''' | Page | required |
Overloaded function number | func | A function page may describe multiple overloaded functions under the same name. This parameter allows you to select one. Allowed values are 1-5, inclusive. | Number | required |
Rendering format | format | "" (empty string) = show everything, "signature" = only show parameter types (i.e. function signature). Default value is empty string (show everything). | Line | optional |
Examples
{{User:Philmasterplus/FunctionDeclaration|name=User:Philmasterplus/Sandbox|func=1}}
Nothing to see here, move along. Nothing to see here, move along.( Nothing to see here, move along.? Nothing to see here, move along. = Nothing to see here, move along., Nothing to see here, move along.? Nothing to see here, move along. = Nothing to see here, move along., Nothing to see here, move along.? Nothing to see here, move along. = Nothing to see here, move along., Nothing to see here, move along.? Nothing to see here, move along. = Nothing to see here, move along., Nothing to see here, move along.? Nothing to see here, move along. = Nothing to see here, move along. )
{{User:Philmasterplus/FunctionDeclaration|name=User:Philmasterplus/Sandbox|func=2}}
Nothing to see here, move along. Nothing to see here, move along.( Nothing to see here, move along.? Nothing to see here, move along. = Nothing to see here, move along., Nothing to see here, move along.? Nothing to see here, move along. = Nothing to see here, move along., Nothing to see here, move along.? Nothing to see here, move along. = Nothing to see here, move along., Nothing to see here, move along.? Nothing to see here, move along. = Nothing to see here, move along., Nothing to see here, move along.? Nothing to see here, move along. = Nothing to see here, move along. )
{{User:Philmasterplus/FunctionDeclaration|name=User:Philmasterplus/Sandbox|func=4}}
Nothing to see here, move along. Nothing to see here, move along.( Nothing to see here, move along.? Nothing to see here, move along. = Nothing to see here, move along., Nothing to see here, move along.? Nothing to see here, move along. = Nothing to see here, move along., Nothing to see here, move along.? Nothing to see here, move along. = Nothing to see here, move along., Nothing to see here, move along.? Nothing to see here, move along. = Nothing to see here, move along., Nothing to see here, move along.? Nothing to see here, move along. = Nothing to see here, move along. )
{{User:Philmasterplus/FunctionDeclaration|name=User:Philmasterplus/Sandbox|func=0}}
Nothing to see here, move along. Nothing to see here, move along.( Nothing to see here, move along.? Nothing to see here, move along. = Nothing to see here, move along., Nothing to see here, move along.? Nothing to see here, move along. = Nothing to see here, move along., Nothing to see here, move along.? Nothing to see here, move along. = Nothing to see here, move along., Nothing to see here, move along.? Nothing to see here, move along. = Nothing to see here, move along., Nothing to see here, move along.? Nothing to see here, move along. = Nothing to see here, move along. )
{{User:Philmasterplus/FunctionDeclaration|name=User:Philmasterplus/Sandbox}}
Nothing to see here, move along. Nothing to see here, move along.( Nothing to see here, move along.? Nothing to see here, move along. = Nothing to see here, move along., Nothing to see here, move along.? Nothing to see here, move along. = Nothing to see here, move along., Nothing to see here, move along.? Nothing to see here, move along. = Nothing to see here, move along., Nothing to see here, move along.? Nothing to see here, move along. = Nothing to see here, move along., Nothing to see here, move along.? Nothing to see here, move along. = Nothing to see here, move along. )