Difference between revisions of "Template:FunctionEmbed"

From Kolmafia
Jump to navigation Jump to search
 
(5 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
   |{{
 
   |{{
 
     #if:{{data|{{{1}}}|function1.return_type}}
 
     #if:{{data|{{{1}}}|function1.return_type}}
     |;{{FunctionDeclaration|name={{{1}}}|func=1|format=signature}}{{
+
     |<p>{{FunctionDeclaration|name={{{1}}}|func=1|format=signature|desc={{{desc|}}}}}</p>{{
 
       #if:{{data|{{{1}}}|function1.short_description}}
 
       #if:{{data|{{{1}}}|function1.short_description}}
       |:{{data|{{{1}}}|function1.short_description}}
+
       |{{data|{{{1}}}|function1.short_description}}
 
     }}
 
     }}
   }}{{
+
   }}
 +
{{
 
     #if:{{data|{{{1}}}|function2.return_type}}
 
     #if:{{data|{{{1}}}|function2.return_type}}
     |;{{FunctionDeclaration|name={{{1}}}|func=2|format=signature}}{{
+
     |<p>{{FunctionDeclaration|name={{{1}}}|func=2|format=signature|desc={{{desc|}}}}}</p>{{
 
       #if:{{data|{{{1}}}|function2.short_description}}
 
       #if:{{data|{{{1}}}|function2.short_description}}
       |:{{data|{{{1}}}|function2.short_description}}
+
       |{{data|{{{1}}}|function2.short_description}}
 
     }}
 
     }}
   }}{{
+
   }}
 +
{{
 
     #if:{{data|{{{1}}}|function3.return_type}}
 
     #if:{{data|{{{1}}}|function3.return_type}}
     |;{{FunctionDeclaration|name={{{1}}}|func=3|format=signature}}{{
+
     |<p>{{FunctionDeclaration|name={{{1}}}|func=3|format=signature|desc={{{desc|}}}}}</p>{{
 
       #if:{{data|{{{1}}}|function3.short_description}}
 
       #if:{{data|{{{1}}}|function3.short_description}}
       |:{{data|{{{1}}}|function3.short_description}}
+
       |{{data|{{{1}}}|function3.short_description}}
 
     }}
 
     }}
   }}{{
+
   }}
 +
{{
 
     #if:{{data|{{{1}}}|function4.return_type}}
 
     #if:{{data|{{{1}}}|function4.return_type}}
     |;{{FunctionDeclaration|name={{{1}}}|func=4|format=signature}}{{
+
     |<p>{{FunctionDeclaration|name={{{1}}}|func=4|format=signature|desc={{{desc|}}}}}</p>{{
 
       #if:{{data|{{{1}}}|function4.short_description}}
 
       #if:{{data|{{{1}}}|function4.short_description}}
       |:{{data|{{{1}}}|function4.short_description}}
+
       |{{data|{{{1}}}|function4.short_description}}
 
     }}
 
     }}
   }}{{
+
   }}{{#if:{{data|{{{1}}}|function5.return_type}}
    #if:{{data|{{{1}}}|function5.return_type}}
+
     |<p>{{FunctionDeclaration|name={{{1}}}|func=5|format=signature|desc={{{desc|}}}}}</p>{{
     |;{{FunctionDeclaration|name={{{1}}}|func=5|format=signature}}{{
 
 
       #if:{{data|{{{1}}}|function5.short_description}}
 
       #if:{{data|{{{1}}}|function5.short_description}}
       |:{{data|{{{1}}}|function5.short_description}}
+
       |{{data|{{{1}}}|function5.short_description}}
 
     }}
 
     }}
 
   }}
 
   }}
Line 40: Line 42:
 
       "label": "Function page name",
 
       "label": "Function page name",
 
       "description": "Must be a new-style function page",
 
       "description": "Must be a new-style function page",
       "type": "wiki-page-name"
+
       "type": "wiki-page-name",
 +
      "required": true
 +
    },
 +
    "desc": {
 +
      "label": "Show function descriptions?",
 +
      "description": "If \"yes\", also show function descriptions.",
 +
      "type": "line"
 
     }
 
     }
 
   }
 
   }
Line 50: Line 58:
  
 
{{FunctionEmbed|visit_url}}
 
{{FunctionEmbed|visit_url}}
 +
 +
<pre>{{FunctionEmbed|visit_url|desc=yes}}</pre>
 +
 +
{{FunctionEmbed|visit_url|desc=yes}}
 +
 +
[[Category:Basic Templates]]
 
</noinclude>
 
</noinclude>

Latest revision as of 13:21, 23 December 2020


Generates a brief description of a function's signature(s). Used to embed function signatures in function list pages.

Template parameters

ParameterDescriptionTypeStatus
Function page name1

Must be a new-style function page

Pagerequired
Show function descriptions?desc

If "yes", also show function descriptions.

Lineoptional

Examples

{{FunctionEmbed|visit_url}}

buffer visit_url()

buffer visit_urlstring, boolean?, boolean? )

{{FunctionEmbed|visit_url|desc=yes}}

buffer visit_url()

Returns the original HTML source of the page being overridden inside a relay override script.

buffer visit_urlstring, boolean?, boolean? )

Visits a web page and returns its HTML source.