Difference between revisions of "Template:Function"

From Kolmafia
Jump to navigation Jump to search
imported>StDoodle
m
imported>StDoodle
m
Line 1: Line 1:
 
<noinclude>This is the template to display a line of function information (for the function page template, see [[Template:FunctionPage]]). Supply the function ''name,'' the data type of the value it ''returns,'' and what, if any, ''parameters'' it takes.[[Category:Basic Templates]]</noinclude>
 
<noinclude>This is the template to display a line of function information (for the function page template, see [[Template:FunctionPage]]). Supply the function ''name,'' the data type of the value it ''returns,'' and what, if any, ''parameters'' it takes.[[Category:Basic Templates]]</noinclude>
<includeonly>{{#if: {{{aggregate|}}}|'''[[|Aggregate{{{returns}}}]]'''|'''[[{{{returns}}}]]'''<nowiki></nowiki>{{#if: {{{returns2|}}}|&nbsp;/ '''[[{{{returns2}}}]]''' }} }}<nowiki> </nowiki>'''{{{function_name}}}('''<nowiki></nowiki>{{#if: {{{parameter1|}}}|{{{parameter1}}}}}{{#if: {{{parameter2|}}}|, {{{parameter2}}}}}{{#if: {{{parameter3|}}}|, {{{parameter3}}}}}{{#if: {{{parameter4|}}}|, {{{parameter4}}}}}{{#if: {{{parameter5|}}}|, {{{parameter5}}}}}<nowiki></nowiki>''')'''
+
<includeonly>
{{#if: {{{p1desc|}}}|<p>Where {{{parameter1}}} is {{{p1desc}}}</p>}}{{#if: {{{p2desc|}}}|<p>Where {{{parameter2}}} is {{{p2desc}}}</p>}}{{#if: {{{p3desc|}}}|<p>Where {{{parameter3}}} is {{{p3desc}}}</p>}}{{#if: {{{p4desc|}}}|<p>Where {{{parameter4}}} is {{{p4desc}}}</p>}}{{#if: {{{p5desc|}}}|<p>Where {{{parameter5}}} is {{{p5desc}}}</p>}}{{#if: {{{description|}}}|<p>{{{description}}}</p>}}
+
{{#vardefine:use_aggregate|{{#if: {{{returns_aggregate|}}}|yes|{{#varexists:returns_aggregate|yes|no}} }} }}
 +
{{#vardefine:use_type|{{#if: {{{return_type|}}}|{{{return_type}}}|{{var:return_type}} }} }}
 +
{{#vardefine:use_also_bool|{{#if: {{{returns_also|}}}|yes|{{#varexists:returns_also|yes|no}} }} }}
 +
{{#vardefine:use_also_line|{{#ifeq: {{#var:use_also_bool}}|no||{{#if: {{{returns_also|}}}|{{{returns_also}}}|{{#var:returns_also}} }} }} }}
 +
 
 +
{{#ifeq: {{#var:use_aggregate}}|yes|[[Aggregate|{{#var:use_type}}]]|[[{{#var:use_type}}]]|}}
 +
{{#ifeq: {{#var:use_also_bool}}|no||{{#ifeq: {{#var:use_aggregate}}|yes|&nbsp;/&nbsp;[[Aggregate|{{#var:use_also_line}}]]|&nbsp;/&nbsp;[[{{#var:use_also_line}}]]}} }}
 +
<b>{{#var:name}}(</b>{{#if: {{{param1|}}}|{{{param1}}}|{{#var:parameter1}} }}{{#if: {{{param2|}}}|{{{param2}}}|{{#var:parameter2}} }}{{#if: {{{param3|}}}|{{{param3}}}|{{#var:parameter3}} }}{{#if: {{{param4|}}}|{{{param4}}}|{{#var:parameter4}} }}{{#if: {{{param5|}}}|{{{param5}}}|{{#var:parameter5}} }}<b>)</b>
 
</includeonly>
 
</includeonly>

Revision as of 09:35, 28 February 2010

This is the template to display a line of function information (for the function page template, see Template:FunctionPage). Supply the function name, the data type of the value it returns, and what, if any, parameters it takes.