Difference between pages "Get chateau" and "Template:Function2"
imported>Paladinwhite (Redirected page to Is unrestricted()) |
(→Notes) |
||
Line 1: | Line 1: | ||
− | # | + | <includeonly>{{TOCright}}{{DISPLAYTITLE:{{{name}}}()}}{{#if: {{{needscode|}}}|{{CodeRequest}}}}{{#if: {{{improvecode|}}}|{{CodeRequest|better=yes}}}} |
+ | {{#if: {{{name|}}}||{{error|Parameter 'name' is missing for User:Philmasterplus/TemplateSandbox2}}}} | ||
+ | ==Function Syntax== | ||
+ | {{#if: {{{function1.return_type|}}} | ||
+ | |<p>{{FunctionDeclaration|name={{{name}}}|func=1|desc=yes}}</p>}} | ||
+ | {{#if: {{{function2.return_type|}}} | ||
+ | |<p>{{FunctionDeclaration|name={{{name}}}|func=2|desc=yes}}</p>}} | ||
+ | {{#if: {{{function3.return_type|}}} | ||
+ | |<p>{{FunctionDeclaration|name={{{name}}}|func=3|desc=yes}}</p>}} | ||
+ | {{#if: {{{function4.return_type|}}} | ||
+ | |<p>{{FunctionDeclaration|name={{{name}}}|func=4|desc=yes}}</p>}} | ||
+ | {{#if: {{{function5.return_type|}}} | ||
+ | |<p>{{FunctionDeclaration|name={{{name}}}|func=5|desc=yes}}</p>}} | ||
+ | |||
+ | {{{description}}} | ||
+ | {{#if: {{{code1|}}}|{{{code1}}}}}{{#if: {{{code2|}}}|{{{code2}}}}}{{#if: {{{code3|}}}|{{{code3}}}}}{{#if: {{{code4|}}}|{{{code4}}}}}{{#if: {{{code5|}}}|{{{code5}}}}} | ||
+ | {{#if: {{{cli_equiv|}}}| | ||
+ | ==CLI Equivalent== | ||
+ | {{{cli_equiv}}}}} | ||
+ | {{#if: {{{see_also|}}}|{{{see_also|}}}}} | ||
+ | {{#if: {{{more_info|}}}| | ||
+ | ==More Information== | ||
+ | {{{more_info}}}}} | ||
+ | {{#if: {{{special|}}}| | ||
+ | ==Special== | ||
+ | {{{special}}}}} | ||
+ | [[Category:Ash Functions]] | ||
+ | </includeonly><noinclude> | ||
+ | <templatedata> | ||
+ | { | ||
+ | "description": "Replacement for Template:FunctionPage. Must be used with function pages that follow a specific format.", | ||
+ | "params": { | ||
+ | "name": { | ||
+ | "label": "ASH function name", | ||
+ | "description": "Name of the ASH function. This should match the function page name.", | ||
+ | "required": true, | ||
+ | "type": "line", | ||
+ | "example": "visit_url" | ||
+ | }, | ||
+ | "description": { | ||
+ | "label": "Description", | ||
+ | "description": "Long description that covers all functions. Note: Use <p></p> to separate paragraphs, because double line breaks don't work", | ||
+ | "required": true, | ||
+ | "type": "content" | ||
+ | }, | ||
+ | "function1.description": { | ||
+ | "label": "Function 1, description", | ||
+ | "description": "Short description for the overloaded function 1 (and so on for functions 2 through 3)", | ||
+ | "required": true, | ||
+ | "type": "content", | ||
+ | "example": "Visits a web page and returns its HTML source." | ||
+ | }, | ||
+ | "function1.return_type": { | ||
+ | "label": "Function 1, return type", | ||
+ | "description": "Return type of the overloaded function 1.", | ||
+ | "required": true, | ||
+ | "type": "line", | ||
+ | "example": "buffer" | ||
+ | }, | ||
+ | "function1.param1": { | ||
+ | "label": "Function 1, parameter 1", | ||
+ | "description": "Name of the parameter 1 of the overloaded function 1 (and so on for parameters 2 through 5).", | ||
+ | "type": "line", | ||
+ | "example": "url" | ||
+ | }, | ||
+ | "function1.param1.description": { | ||
+ | "label": "Function 1, parameter 1 description", | ||
+ | "description": "Description of parameter 1 of the overloaded function 1.", | ||
+ | "type": "content", | ||
+ | "example": "URL of the page to visit. If a relative URL is provided, it is treated as an in-game page." | ||
+ | }, | ||
+ | "function1.param1.optional": { | ||
+ | "label": "Function 1, parameter 1 is optional?", | ||
+ | "description": "\"yes\" = optional. Any non-empty string will do, but please use \"yes\" to make standardization easier.", | ||
+ | "type": "line", | ||
+ | "example": "yes" | ||
+ | }, | ||
+ | "function1.param1.default": { | ||
+ | "label": "Function 1, parameter 1 default value", | ||
+ | "description": "If this is specified, function1.param1.optional must be \"yes\"", | ||
+ | "type": "line", | ||
+ | "example": "\"\"" | ||
+ | }, | ||
+ | "code1": { | ||
+ | "label": "Example code 1", | ||
+ | "description": "Example code showing how to use this function. Use [[Template:CodeSample]] to create sample code. (Same for code2 through code5)", | ||
+ | "type": "content" | ||
+ | }, | ||
+ | "cli_equiv": { | ||
+ | "label": "Equivalent gCLI command", | ||
+ | "description": "If provided, must be a gCLI command that provides functionality equivalent to this function.", | ||
+ | "type": "line" | ||
+ | }, | ||
+ | "see_also": { | ||
+ | "label": "See Also section", | ||
+ | "description": "If provided, this is used as the content for the See Also section. Use [[Template:SeeAlso]] to build a See Also section.", | ||
+ | "type": "content" | ||
+ | }, | ||
+ | "more_info": { | ||
+ | "label": "More Information section", | ||
+ | "description": "If provided, this is used as the content for the More Information section", | ||
+ | "type": "content" | ||
+ | }, | ||
+ | "special": { | ||
+ | "label": "Special section", | ||
+ | "description": "If provided, this is used as the content for the Special section", | ||
+ | "type": "content" | ||
+ | }, | ||
+ | "needscode": { | ||
+ | "label": "Needs code samples?", | ||
+ | "description": "If set to \"yes\", adds a \"needs code samples\" banner and categorizes the page under [[Category:Needs Code Sample]].", | ||
+ | "type": "line" | ||
+ | }, | ||
+ | "improvecode": { | ||
+ | "label": "Needs improved code samples?", | ||
+ | "description": "If set to \"yes\", adds a \"needs better code samples\" banner and categorizes the page under [[Category:Needs Code Sample]].", | ||
+ | "type": "line" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </templatedata> | ||
+ | |||
+ | ==Notes== | ||
+ | This template is not meant to be used directly, but rather through the use of <pre>{{{format|User:Philmasterplus/TemplateSandbox2}}}</pre> in a data-driven function page. | ||
+ | </noinclude> |
Revision as of 10:30, 20 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 |
Description | description | Long description that covers all functions. Note: Use <p></p> to separate paragraphs, because double line breaks don't work | Content | required |
Function 1, description | function1.description | Short description for the overloaded function 1 (and so on for functions 2 through 3)
| Content | required |
Function 1, return type | function1.return_type | Return type of the overloaded function 1.
| Line | required |
Function 1, parameter 1 | function1.param1 | Name of the parameter 1 of the overloaded function 1 (and so on for parameters 2 through 5).
| Line | optional |
Function 1, parameter 1 description | function1.param1.description | Description of parameter 1 of the overloaded function 1.
| Content | optional |
Function 1, parameter 1 is optional? | function1.param1.optional | "yes" = optional. Any non-empty string will do, but please use "yes" to make standardization easier.
| Line | optional |
Function 1, parameter 1 default value | function1.param1.default | If this is specified, function1.param1.optional must be "yes"
| Line | optional |
Example code 1 | code1 | Example code showing how to use this function. Use [[Template:CodeSample]] to create sample code. (Same for code2 through code5) | Content | optional |
Equivalent gCLI command | cli_equiv | If provided, must be a gCLI command that provides functionality equivalent to this function. | Line | optional |
See Also section | see_also | If provided, this is used as the content for the See Also section. Use [[Template:SeeAlso]] to build a See Also section. | Content | optional |
More Information section | more_info | If provided, this is used as the content for the More Information section | Content | optional |
Special section | special | If provided, this is used as the content for the Special section | Content | optional |
Needs code samples? | needscode | If set to "yes", adds a "needs code samples" banner and categorizes the page under [[Category:Needs Code Sample]]. | Line | optional |
Needs improved code samples? | improvecode | If set to "yes", adds a "needs better code samples" banner and categorizes the page under [[Category:Needs Code Sample]]. | Line | optional |
Notes
This template is not meant to be used directly, but rather through the use of
{{{format|User:Philmasterplus/TemplateSandbox2}}}
in a data-driven function page.