Template:FunctionEmbed: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
Created page with "<includeonly>{{#ifexist:{{{1|}}} |{{#if:{{User:Philmasterplus/Data|{{{1|}}}|function1.return_type|}} |<div>{{User:Philmasterplus/FunctionDeclaration |name={{User:P..."
 
No edit summary
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#ifexist:{{{1|}}}
<includeonly>{{#ifexist:{{{1|}}}
   |{{#if:{{User:Philmasterplus/Data|{{{1|}}}|function1.return_type|}}
   |{{
     |<div>{{User:Philmasterplus/FunctionDeclaration
     #if:{{data|{{{1}}}|function1.return_type}}
      |name={{User:Philmasterplus/Data|{{{1|}}}|name|}}
     |<p>{{FunctionDeclaration|name={{{1}}}|func=1|format=signature|desc={{{desc|}}}}}</p>{{
      |return_type={{User:Philmasterplus/Data|{{{1|}}}|function1.return_type|}}
       #if:{{data|{{{1}}}|function1.short_description}}
      |param1.type={{User:Philmasterplus/Data|{{{1|}}}|function1.param1.type|}}
       |{{data|{{{1}}}|function1.short_description}}
      |param1.optional={{User:Philmasterplus/Data|{{{1|}}}|function1.param1.optional|}}
     }}
      |param1.default={{User:Philmasterplus/Data|{{{1|}}}|function1.param1.default|}}
      |param2.type={{User:Philmasterplus/Data|{{{1|}}}|function1.param2.type|}}
      |param2.optional={{User:Philmasterplus/Data|{{{1|}}}|function1.param2.optional|}}
      |param2.default={{User:Philmasterplus/Data|{{{1|}}}|function1.param2.default|}}
      |param3.type={{User:Philmasterplus/Data|{{{1|}}}|function1.param3.type|}}
      |param3.optional={{User:Philmasterplus/Data|{{{1|}}}|function1.param3.optional|}}
      |param3.default={{User:Philmasterplus/Data|{{{1|}}}|function1.param3.default|}}
      |param4.type={{User:Philmasterplus/Data|{{{1|}}}|function1.param4.type|}}
      |param4.optional={{User:Philmasterplus/Data|{{{1|}}}|function1.param4.optional|}}
      |param4.default={{User:Philmasterplus/Data|{{{1|}}}|function1.param4.default|}}
      |param5.type={{User:Philmasterplus/Data|{{{1|}}}|function1.param5.type|}}
      |param5.optional={{User:Philmasterplus/Data|{{{1|}}}|function1.param5.optional|}}
      |param5.default={{User:Philmasterplus/Data|{{{1|}}}|function1.param5.default|}}
    </div>}}
  }}{{#if:{{User:Philmasterplus/Data|{{{1|}}}|function2.return_type|}}
     |<div>{{User:Philmasterplus/FunctionDeclaration
      |name={{User:Philmasterplus/Data|{{{1|}}}|name|}}
      |return_type={{User:Philmasterplus/Data|{{{1|}}}|function2.return_type|}}
      |param1.type={{User:Philmasterplus/Data|{{{1|}}}|function2.param1.type|}}
      |param1.optional={{User:Philmasterplus/Data|{{{1|}}}|function2.param1.optional|}}
      |param1.default={{User:Philmasterplus/Data|{{{1|}}}|function2.param1.default|}}
      |param2.type={{User:Philmasterplus/Data|{{{1|}}}|function2.param2.type|}}
      |param2.optional={{User:Philmasterplus/Data|{{{1|}}}|function2.param2.optional|}}
      |param2.default={{User:Philmasterplus/Data|{{{1|}}}|function2.param2.default|}}
      |param3.type={{User:Philmasterplus/Data|{{{1|}}}|function2.param3.type|}}
      |param3.optional={{User:Philmasterplus/Data|{{{1|}}}|function2.param3.optional|}}
      |param3.default={{User:Philmasterplus/Data|{{{1|}}}|function2.param3.default|}}
      |param4.type={{User:Philmasterplus/Data|{{{1|}}}|function2.param4.type|}}
      |param4.optional={{User:Philmasterplus/Data|{{{1|}}}|function2.param4.optional|}}
      |param4.default={{User:Philmasterplus/Data|{{{1|}}}|function2.param4.default|}}
      |param5.type={{User:Philmasterplus/Data|{{{1|}}}|function2.param5.type|}}
      |param5.optional={{User:Philmasterplus/Data|{{{1|}}}|function2.param5.optional|}}
      |param5.default={{User:Philmasterplus/Data|{{{1|}}}|function2.param5.default|}}
    </div>}}
  }}{{#if:{{User:Philmasterplus/Data|{{{1|}}}|function3.return_type|}}
    |<div>{{User:Philmasterplus/FunctionDeclaration
      |name={{User:Philmasterplus/Data|{{{1|}}}|name|}}
      |return_type={{User:Philmasterplus/Data|{{{1|}}}|function3.return_type|}}
       |param1.type={{User:Philmasterplus/Data|{{{1|}}}|function3.param1.type|}}
      |param1.optional={{User:Philmasterplus/Data|{{{1|}}}|function3.param1.optional|}}
      |param1.default={{User:Philmasterplus/Data|{{{1|}}}|function3.param1.default|}}
      |param2.type={{User:Philmasterplus/Data|{{{1|}}}|function3.param2.type|}}
      |param2.optional={{User:Philmasterplus/Data|{{{1|}}}|function3.param2.optional|}}
      |param2.default={{User:Philmasterplus/Data|{{{1|}}}|function3.param2.default|}}
      |param3.type={{User:Philmasterplus/Data|{{{1|}}}|function3.param3.type|}}
      |param3.optional={{User:Philmasterplus/Data|{{{1|}}}|function3.param3.optional|}}
      |param3.default={{User:Philmasterplus/Data|{{{1|}}}|function3.param3.default|}}
      |param4.type={{User:Philmasterplus/Data|{{{1|}}}|function3.param4.type|}}
      |param4.optional={{User:Philmasterplus/Data|{{{1|}}}|function3.param4.optional|}}
      |param4.default={{User:Philmasterplus/Data|{{{1|}}}|function3.param4.default|}}
      |param5.type={{User:Philmasterplus/Data|{{{1|}}}|function3.param5.type|}}
      |param5.optional={{User:Philmasterplus/Data|{{{1|}}}|function3.param5.optional|}}
      |param5.default={{User:Philmasterplus/Data|{{{1|}}}|function3.param5.default|}}
    </div>}}
  }}{{#if:{{User:Philmasterplus/Data|{{{1|}}}|function4.return_type|}}
    |<div>{{User:Philmasterplus/FunctionDeclaration
      |name={{User:Philmasterplus/Data|{{{1|}}}|name|}}
       |return_type={{User:Philmasterplus/Data|{{{1|}}}|function4.return_type|}}
      |param1.type={{User:Philmasterplus/Data|{{{1|}}}|function4.param1.type|}}
      |param1.optional={{User:Philmasterplus/Data|{{{1|}}}|function4.param1.optional|}}
      |param1.default={{User:Philmasterplus/Data|{{{1|}}}|function4.param1.default|}}
      |param2.type={{User:Philmasterplus/Data|{{{1|}}}|function4.param2.type|}}
      |param2.optional={{User:Philmasterplus/Data|{{{1|}}}|function4.param2.optional|}}
      |param2.default={{User:Philmasterplus/Data|{{{1|}}}|function4.param2.default|}}
      |param3.type={{User:Philmasterplus/Data|{{{1|}}}|function4.param3.type|}}
      |param3.optional={{User:Philmasterplus/Data|{{{1|}}}|function4.param3.optional|}}
      |param3.default={{User:Philmasterplus/Data|{{{1|}}}|function4.param3.default|}}
      |param4.type={{User:Philmasterplus/Data|{{{1|}}}|function4.param4.type|}}
      |param4.optional={{User:Philmasterplus/Data|{{{1|}}}|function4.param4.optional|}}
      |param4.default={{User:Philmasterplus/Data|{{{1|}}}|function4.param4.default|}}
      |param5.type={{User:Philmasterplus/Data|{{{1|}}}|function4.param5.type|}}
      |param5.optional={{User:Philmasterplus/Data|{{{1|}}}|function4.param5.optional|}}
      |param5.default={{User:Philmasterplus/Data|{{{1|}}}|function4.param5.default|}}
    </div>}}
  }}{{#if:{{User:Philmasterplus/Data|{{{1|}}}|function5.return_type|}}
    |<div>{{User:Philmasterplus/FunctionDeclaration
      |name={{User:Philmasterplus/Data|{{{1|}}}|name|}}
      |return_type={{User:Philmasterplus/Data|{{{1|}}}|function5.return_type|}}
      |param1.type={{User:Philmasterplus/Data|{{{1|}}}|function5.param1.type|}}
      |param1.optional={{User:Philmasterplus/Data|{{{1|}}}|function5.param1.optional|}}
      |param1.default={{User:Philmasterplus/Data|{{{1|}}}|function5.param1.default|}}
      |param2.type={{User:Philmasterplus/Data|{{{1|}}}|function5.param2.type|}}
      |param2.optional={{User:Philmasterplus/Data|{{{1|}}}|function5.param2.optional|}}
      |param2.default={{User:Philmasterplus/Data|{{{1|}}}|function5.param2.default|}}
      |param3.type={{User:Philmasterplus/Data|{{{1|}}}|function5.param3.type|}}
      |param3.optional={{User:Philmasterplus/Data|{{{1|}}}|function5.param3.optional|}}
      |param3.default={{User:Philmasterplus/Data|{{{1|}}}|function5.param3.default|}}
      |param4.type={{User:Philmasterplus/Data|{{{1|}}}|function5.param4.type|}}
      |param4.optional={{User:Philmasterplus/Data|{{{1|}}}|function5.param4.optional|}}
      |param4.default={{User:Philmasterplus/Data|{{{1|}}}|function5.param4.default|}}
      |param5.type={{User:Philmasterplus/Data|{{{1|}}}|function5.param5.type|}}
      |param5.optional={{User:Philmasterplus/Data|{{{1|}}}|function5.param5.optional|}}
      |param5.default={{User:Philmasterplus/Data|{{{1|}}}|function5.param5.default|}}
     </div>}}
   }}
   }}
   |{{{error|Cannot find page '{{{1|}}}' for template User:Philmasterplus/FunctionEmbed}}
{{
}}
    #if:{{data|{{{1}}}|function2.return_type}}
</includeonly><noinclude>
    |<p>{{FunctionDeclaration|name={{{1}}}|func=2|format=signature|desc={{{desc|}}}}}</p>{{
      #if:{{data|{{{1}}}|function2.short_description}}
      |{{data|{{{1}}}|function2.short_description}}
    }}
  }}
{{
    #if:{{data|{{{1}}}|function3.return_type}}
    |<p>{{FunctionDeclaration|name={{{1}}}|func=3|format=signature|desc={{{desc|}}}}}</p>{{
      #if:{{data|{{{1}}}|function3.short_description}}
      |{{data|{{{1}}}|function3.short_description}}
    }}
  }}
{{
    #if:{{data|{{{1}}}|function4.return_type}}
    |<p>{{FunctionDeclaration|name={{{1}}}|func=4|format=signature|desc={{{desc|}}}}}</p>{{
      #if:{{data|{{{1}}}|function4.short_description}}
      |{{data|{{{1}}}|function4.short_description}}
    }}
   }}{{#if:{{data|{{{1}}}|function5.return_type}}
    |<p>{{FunctionDeclaration|name={{{1}}}|func=5|format=signature|desc={{{desc|}}}}}</p>{{
      #if:{{data|{{{1}}}|function5.short_description}}
      |{{data|{{{1}}}|function5.short_description}}
    }}
  }}
  |{{error|Cannot find page "{{{1|}}}" for Template:FunctionEmbed}}}}</includeonly><noinclude>


<templatedata>
<templatedata>
Line 112: 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 119: Line 55:


==Examples==
==Examples==
<pre>{{User:Philmasterplus/FunctionEmbed|User:Philmasterplus/Sandbox}}</pre>
<pre>{{FunctionEmbed|visit_url}}</pre>
 
{{FunctionEmbed|visit_url}}
 
<pre>{{FunctionEmbed|visit_url|desc=yes}}</pre>
 
{{FunctionEmbed|visit_url|desc=yes}}


{{User:Philmasterplus/FunctionEmbed|User:Philmasterplus/Sandbox}}
[[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[Edit template data]

ParameterDescriptionTypeStatus
Function page name1

Must be a new-style function page

Page namerequired
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.