Template:Function2: Difference between revisions
No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
==Function Syntax== | ==Function Syntax== | ||
{{#if: {{{function1.return_type|}}} | {{#if: {{{function1.return_type|}}} | ||
|'''{{{function1.return_type}}} {{{name}}}({{ | |'''<code>{{{function1.return_type}}} {{{name}}}({{ | ||
#if: {{{function1.parameter1|}}} | #if: {{{function1.parameter1|}}} | ||
|{{#if: {{{function1.parameter1.optional|}}}|<nowiki>[</nowiki>}}{{{ | |{{#if: {{{function1.parameter1.optional|}}}|<nowiki>[</nowiki>}}{{{ | ||
Line 21: | Line 21: | ||
#if: {{{function1.parameter3.default|}}}| = {{{function1.parameter3.default|}}}}}{{ | #if: {{{function1.parameter3.default|}}}| = {{{function1.parameter3.default|}}}}}{{ | ||
#if: {{{function1.parameter3.optional|}}}|<nowiki>]</nowiki>}} | #if: {{{function1.parameter3.optional|}}}|<nowiki>]</nowiki>}} | ||
}})'''{{ | }})</code>'''{{ | ||
#if: {{{function1.parameter1|}}} | #if: {{{function1.parameter1|}}} | ||
|<ul><li>'''{{{function1.parameter1.type}}} {{Pspan|{{{function1.parameter1}}}}}''': {{{function1.parameter1.description}}}</li>}}{{ | |<ul><li>'''{{{function1.parameter1.type}}} {{Pspan|{{{function1.parameter1}}}}}''': {{{function1.parameter1.description}}}</li>}}{{ | ||
Line 32: | Line 32: | ||
}} | }} | ||
{{#if: {{{function2.return_type|}}} | {{#if: {{{function2.return_type|}}} | ||
|'''{{{function2.return_type}}} {{{name}}}({{ | |'''<code>{{{function2.return_type}}} {{{name}}}({{ | ||
#if: {{{function2.parameter1|}}} | #if: {{{function2.parameter1|}}} | ||
|{{#if: {{{function2.parameter1.optional|}}}|<nowiki>[</nowiki>}}{{{ | |{{#if: {{{function2.parameter1.optional|}}}|<nowiki>[</nowiki>}}{{{ | ||
Line 50: | Line 50: | ||
#if: {{{function2.parameter3.default|}}}| = {{{function2.parameter3.default|}}}}}{{ | #if: {{{function2.parameter3.default|}}}| = {{{function2.parameter3.default|}}}}}{{ | ||
#if: {{{function2.parameter3.optional|}}}|<nowiki>]</nowiki>}} | #if: {{{function2.parameter3.optional|}}}|<nowiki>]</nowiki>}} | ||
}})'''{{ | }})</code>'''{{ | ||
#if: {{{function2.parameter1|}}} | #if: {{{function2.parameter1|}}} | ||
|<ul><li>'''{{{function2.parameter1.type}}} {{Pspan|{{{function2.parameter1}}}}}''': {{{function2.parameter1.description}}}</li>}}{{ | |<ul><li>'''{{{function2.parameter1.type}}} {{Pspan|{{{function2.parameter1}}}}}''': {{{function2.parameter1.description}}}</li>}}{{ | ||
Line 60: | Line 60: | ||
#if: {{{function2.short_description|}}}|: {{{function2.short_description}}}}} | #if: {{{function2.short_description|}}}|: {{{function2.short_description}}}}} | ||
}} | }} | ||
{{#if: {{{ | {{#if: {{{function1.return_type|}}} | ||
|'''{{{ | |'''<code>{{{function1.return_type}}} {{{name}}}({{ | ||
#if: {{{ | #if: {{{function1.parameter1|}}} | ||
|{{#if: {{{ | |{{#if: {{{function1.parameter1.optional|}}}|<nowiki>[</nowiki>}}{{{ | ||
function1.parameter1.type|{{error|Parameter 'function1.parameter1.type' is missing for User:Philmasterplus/TemplateSandbox2}}}}} {{Pspan|{{{function1.parameter1}}}}}{{ | |||
#if: {{{ | #if: {{{function1.parameter1.default|}}}| = {{{function1.parameter1.default|}}}}}{{ | ||
#if: {{{ | #if: {{{function1.parameter1.optional|}}}|<nowiki>]</nowiki>}} | ||
}}{{ | }}{{ | ||
#if: {{{ | #if: {{{function1.parameter2|}}} | ||
|{{#if: {{{ | |{{#if: {{{function1.parameter2.optional|}}}|<nowiki>[</nowiki>}}, {{{ | ||
function1.parameter2.type|{{error|Parameter 'function1.parameter2.type' is missing for User:Philmasterplus/TemplateSandbox2}}}}} {{Pspan|{{{function1.parameter2}}}}}{{ | |||
#if: {{{ | #if: {{{function1.parameter2.default|}}}| = {{{function1.parameter2.default|}}}}}{{ | ||
#if: {{{ | #if: {{{function1.parameter2.optional|}}}|<nowiki>]</nowiki>}} | ||
}}{{ | }}{{ | ||
#if: {{{ | #if: {{{function1.parameter3|}}} | ||
|{{#if: {{{ | |{{#if: {{{function1.parameter3.optional|}}}|<nowiki>[</nowiki>}}, {{{ | ||
function1.parameter3.type|{{error|Parameter 'function1.parameter3.type' is missing for User:Philmasterplus/TemplateSandbox2}}}}} {{Pspan|{{{function1.parameter3}}}}}{{ | |||
#if: {{{ | #if: {{{function1.parameter3.default|}}}| = {{{function1.parameter3.default|}}}}}{{ | ||
#if: {{{ | #if: {{{function1.parameter3.optional|}}}|<nowiki>]</nowiki>}} | ||
}})'''{{ | }})</code>'''{{ | ||
#if: {{{ | #if: {{{function1.parameter1|}}} | ||
|<ul><li>'''{{{ | |<ul><li>'''{{{function1.parameter1.type}}} {{Pspan|{{{function1.parameter1}}}}}''': {{{function1.parameter1.description}}}</li>}}{{ | ||
#if: {{{ | #if: {{{function1.parameter2|}}} | ||
|<li>'''{{{ | |<li>'''{{{function1.parameter2.type}}} {{Pspan|{{{function1.parameter2}}}}}''': {{{function1.parameter2.description}}}</li>}}{{ | ||
#if: {{{ | #if: {{{function1.parameter3|}}} | ||
|<li>'''{{{ | |<li>'''{{{function1.parameter3.type}}} {{Pspan|{{{function1.parameter3}}}}}''': {{{function1.parameter3.description}}}</li>}}{{ | ||
#if: {{{ | #if: {{{function1.parameter1|}}}|</ul>}}{{ | ||
#if: {{{ | #if: {{{function1.short_description|}}}|: {{{function1.short_description}}}}} | ||
}} | }} | ||
{{#if: {{{code1|}}}|{{{code1}}}}}{{#if: {{{code2|}}}|{{{code2}}}}}{{#if: {{{code3|}}}|{{{code3}}}}}{{#if: {{{code4|}}}|{{{code4}}}}}{{#if: {{{code5|}}}|{{{code5}}}}} | {{#if: {{{code1|}}}|{{{code1}}}}}{{#if: {{{code2|}}}|{{{code2}}}}}{{#if: {{{code3|}}}|{{{code3}}}}}{{#if: {{{code4|}}}|{{{code4}}}}}{{#if: {{{code5|}}}|{{{code5}}}}} |
Revision as of 16:14, 18 December 2020
Replacement for Template:FunctionPage. Must be used with function pages that follow a specific format.
Parameter | Description | Type | Status | |
---|---|---|---|---|
ASH function name | name | Name of the ASH function. This should match the function page name.
| Line | required |
Function 1, short description | function1.short_description | Short description for the 1st overloaded form of the function
| Content | optional |
Function 1, return type | function1.return_type | Return type of the 1st overloaded form of the function.
| Line | required |
Function 1, parameter 1 | function1.parameter1 | Name of the parameter 1 of the 1st overloaded form of the function.
| Line | optional |
Function 1, parameter 1 description | function1.parameter1.description | Description of parameter 1 of the 1st overloaded form of the function.
| Content | optional |
Function 1, parameter 1 is optional? | function1.parameter1.optional | Whether parameter 1 of the 1st overloaded form of the function is optional. Note that ASH does not support truly optional parameters; a function with optional parameters is actually multiple overloaded functions.
| Boolean | optional |
Function 1, parameter 1 default value | function1.parameter1.default | The default value of parameter 1 of the 1st overloaded form of the function. This should be used in conjunction with function1.parameter1.optional
| Line | optional |