Template:Function2: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
No edit summary
No edit summary
Line 7: Line 7:
     |{{#if: {{{function1.parameter1.optional|}}}|<nowiki>[</nowiki>}}{{{
     |{{#if: {{{function1.parameter1.optional|}}}|<nowiki>[</nowiki>}}{{{
     function1.parameter1.type|{{error|Parameter 'function1.parameter1.type' is missing for User:Philmasterplus/TemplateSandbox2}}}}} {{Pspan|{{{function1.parameter1}}}}}{{
     function1.parameter1.type|{{error|Parameter 'function1.parameter1.type' is missing for User:Philmasterplus/TemplateSandbox2}}}}} {{Pspan|{{{function1.parameter1}}}}}{{
    #if: {{{function1.parameter1.default|}}}| = {{{function1.parameter1.default|}}}}}{{
     #if: {{{function1.parameter1.optional|}}}|<nowiki>]</nowiki>}}
     #if: {{{function1.parameter1.optional|}}}|<nowiki>]</nowiki>}}
   }}{{
   }}{{
Line 12: Line 13:
     |{{#if: {{{function1.parameter2.optional|}}}|<nowiki>[</nowiki>}}, {{{
     |{{#if: {{{function1.parameter2.optional|}}}|<nowiki>[</nowiki>}}, {{{
       function1.parameter2.type|{{error|Parameter 'function1.parameter2.type' is missing for User:Philmasterplus/TemplateSandbox2}}}}} {{Pspan|{{{function1.parameter2}}}}}{{
       function1.parameter2.type|{{error|Parameter 'function1.parameter2.type' is missing for User:Philmasterplus/TemplateSandbox2}}}}} {{Pspan|{{{function1.parameter2}}}}}{{
    #if: {{{function1.parameter2.default|}}}| = {{{function1.parameter2.default|}}}}}{{
     #if: {{{function1.parameter2.optional|}}}|<nowiki>]</nowiki>}}
     #if: {{{function1.parameter2.optional|}}}|<nowiki>]</nowiki>}}
   }}{{
   }}{{
Line 17: Line 19:
     |{{#if: {{{function1.parameter3.optional|}}}|<nowiki>[</nowiki>}}, {{{
     |{{#if: {{{function1.parameter3.optional|}}}|<nowiki>[</nowiki>}}, {{{
       function1.parameter3.type|{{error|Parameter 'function1.parameter3.type' is missing for User:Philmasterplus/TemplateSandbox2}}}}} {{Pspan|{{{function1.parameter3}}}}}{{
       function1.parameter3.type|{{error|Parameter 'function1.parameter3.type' is missing for User:Philmasterplus/TemplateSandbox2}}}}} {{Pspan|{{{function1.parameter3}}}}}{{
    #if: {{{function1.parameter3.default|}}}| = {{{function1.parameter3.default|}}}}}{{
     #if: {{{function1.parameter3.optional|}}}|<nowiki>]</nowiki>}}
     #if: {{{function1.parameter3.optional|}}}|<nowiki>]</nowiki>}}
   }})'''{{
   }})'''{{
Line 33: Line 36:
     |{{#if: {{{function2.parameter1.optional|}}}|<nowiki>[</nowiki>}}{{{
     |{{#if: {{{function2.parameter1.optional|}}}|<nowiki>[</nowiki>}}{{{
     function2.parameter1.type|{{error|Parameter 'function2.parameter1.type' is missing for User:Philmasterplus/TemplateSandbox2}}}}} {{Pspan|{{{function2.parameter1}}}}}{{
     function2.parameter1.type|{{error|Parameter 'function2.parameter1.type' is missing for User:Philmasterplus/TemplateSandbox2}}}}} {{Pspan|{{{function2.parameter1}}}}}{{
    #if: {{{function2.parameter1.default|}}}| = {{{function2.parameter1.default|}}}}}{{
     #if: {{{function2.parameter1.optional|}}}|<nowiki>]</nowiki>}}
     #if: {{{function2.parameter1.optional|}}}|<nowiki>]</nowiki>}}
   }}{{
   }}{{
Line 38: Line 42:
     |{{#if: {{{function2.parameter2.optional|}}}|<nowiki>[</nowiki>}}, {{{
     |{{#if: {{{function2.parameter2.optional|}}}|<nowiki>[</nowiki>}}, {{{
       function2.parameter2.type|{{error|Parameter 'function2.parameter2.type' is missing for User:Philmasterplus/TemplateSandbox2}}}}} {{Pspan|{{{function2.parameter2}}}}}{{
       function2.parameter2.type|{{error|Parameter 'function2.parameter2.type' is missing for User:Philmasterplus/TemplateSandbox2}}}}} {{Pspan|{{{function2.parameter2}}}}}{{
    #if: {{{function2.parameter2.default|}}}| = {{{function2.parameter2.default|}}}}}{{
     #if: {{{function2.parameter2.optional|}}}|<nowiki>]</nowiki>}}
     #if: {{{function2.parameter2.optional|}}}|<nowiki>]</nowiki>}}
   }}{{
   }}{{
Line 43: Line 48:
     |{{#if: {{{function2.parameter3.optional|}}}|<nowiki>[</nowiki>}}, {{{
     |{{#if: {{{function2.parameter3.optional|}}}|<nowiki>[</nowiki>}}, {{{
       function2.parameter3.type|{{error|Parameter 'function2.parameter3.type' is missing for User:Philmasterplus/TemplateSandbox2}}}}} {{Pspan|{{{function2.parameter3}}}}}{{
       function2.parameter3.type|{{error|Parameter 'function2.parameter3.type' is missing for User:Philmasterplus/TemplateSandbox2}}}}} {{Pspan|{{{function2.parameter3}}}}}{{
    #if: {{{function2.parameter3.default|}}}| = {{{function2.parameter3.default|}}}}}{{
     #if: {{{function2.parameter3.optional|}}}|<nowiki>]</nowiki>}}
     #if: {{{function2.parameter3.optional|}}}|<nowiki>]</nowiki>}}
   }})'''{{
   }})'''{{
Line 59: Line 65:
     |{{#if: {{{function3.parameter1.optional|}}}|<nowiki>[</nowiki>}}{{{
     |{{#if: {{{function3.parameter1.optional|}}}|<nowiki>[</nowiki>}}{{{
     function3.parameter1.type|{{error|Parameter 'function3.parameter1.type' is missing for User:Philmasterplus/TemplateSandbox2}}}}} {{Pspan|{{{function3.parameter1}}}}}{{
     function3.parameter1.type|{{error|Parameter 'function3.parameter1.type' is missing for User:Philmasterplus/TemplateSandbox2}}}}} {{Pspan|{{{function3.parameter1}}}}}{{
    #if: {{{function3.parameter1.default|}}}| = {{{function3.parameter1.default|}}}}}{{
     #if: {{{function3.parameter1.optional|}}}|<nowiki>]</nowiki>}}
     #if: {{{function3.parameter1.optional|}}}|<nowiki>]</nowiki>}}
   }}{{
   }}{{
Line 64: Line 71:
     |{{#if: {{{function3.parameter2.optional|}}}|<nowiki>[</nowiki>}}, {{{
     |{{#if: {{{function3.parameter2.optional|}}}|<nowiki>[</nowiki>}}, {{{
       function3.parameter2.type|{{error|Parameter 'function3.parameter2.type' is missing for User:Philmasterplus/TemplateSandbox2}}}}} {{Pspan|{{{function3.parameter2}}}}}{{
       function3.parameter2.type|{{error|Parameter 'function3.parameter2.type' is missing for User:Philmasterplus/TemplateSandbox2}}}}} {{Pspan|{{{function3.parameter2}}}}}{{
    #if: {{{function3.parameter2.default|}}}| = {{{function3.parameter2.default|}}}}}{{
     #if: {{{function3.parameter2.optional|}}}|<nowiki>]</nowiki>}}
     #if: {{{function3.parameter2.optional|}}}|<nowiki>]</nowiki>}}
   }}{{
   }}{{
Line 69: Line 77:
     |{{#if: {{{function3.parameter3.optional|}}}|<nowiki>[</nowiki>}}, {{{
     |{{#if: {{{function3.parameter3.optional|}}}|<nowiki>[</nowiki>}}, {{{
       function3.parameter3.type|{{error|Parameter 'function3.parameter3.type' is missing for User:Philmasterplus/TemplateSandbox2}}}}} {{Pspan|{{{function3.parameter3}}}}}{{
       function3.parameter3.type|{{error|Parameter 'function3.parameter3.type' is missing for User:Philmasterplus/TemplateSandbox2}}}}} {{Pspan|{{{function3.parameter3}}}}}{{
    #if: {{{function3.parameter3.default|}}}| = {{{function3.parameter3.default|}}}}}{{
     #if: {{{function3.parameter3.optional|}}}|<nowiki>]</nowiki>}}
     #if: {{{function3.parameter3.optional|}}}|<nowiki>]</nowiki>}}
   }})'''{{
   }})'''{{

Revision as of 16:12, 18 December 2020

Replacement for Template:FunctionPage. Must be used with function pages that follow a specific format.

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
ASH function namename

Name of the ASH function. This should match the function page name.

Example
visit_url
Linerequired
Function 1, short descriptionfunction1.short_description

Short description for the 1st overloaded form of the function

Example
Visits a web page and returns its HTML source.
Contentoptional
Function 1, return typefunction1.return_type

Return type of the 1st overloaded form of the function.

Example
buffer
Linerequired
Function 1, parameter 1function1.parameter1

Name of the parameter 1 of the 1st overloaded form of the function.

Example
url
Lineoptional
Function 1, parameter 1 descriptionfunction1.parameter1.description

Description of parameter 1 of the 1st overloaded form of the function.

Example
URL of the page to visit. If a relative URL is provided, it is treated as an in-game page.
Contentoptional
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.

Default
0
Example
1
Booleanoptional
Function 1, parameter 1 default valuefunction1.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

Example
0
Lineoptional