Difference between revisions of "Template:FunctionEmbed"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
<includeonly>{{#ifexist:{{{1|}}} | <includeonly>{{#ifexist:{{{1|}}} | ||
|{{#if:{{data|{{{1}}}|function1.return_type}} | |{{#if:{{data|{{{1}}}|function1.return_type}} | ||
− | |{{FunctionDeclaration|name={{{1}}}|func=1|format=signature}}{{ | + | |{{FunctionDeclaration|name={{{1}}}|func=1|format=signature|desc={{{desc|}}}}}{{ |
#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}}{{ | + | |;{{FunctionDeclaration|name={{{1}}}|func=2|format=signature|desc={{{desc|}}}}}{{ |
#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}}{{ | + | |;{{FunctionDeclaration|name={{{1}}}|func=3|format=signature|desc={{{desc|}}}}}{{ |
#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}}{{ | + | |;{{FunctionDeclaration|name={{{1}}}|func=4|format=signature|desc={{{desc|}}}}}{{ |
#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}} | ||
− | |;{{FunctionDeclaration|name={{{1}}}|func=5|format=signature}}{{ | + | |;{{FunctionDeclaration|name={{{1}}}|func=5|format=signature|desc={{{desc|}}}}}{{ |
#if:{{data|{{{1}}}|function5.short_description}} | #if:{{data|{{{1}}}|function5.short_description}} | ||
|:{{data|{{{1}}}|function5.short_description}} | |:{{data|{{{1}}}|function5.short_description}} | ||
Line 35: | Line 35: | ||
"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 45: | Line 51: | ||
{{FunctionEmbed|visit_url}} | {{FunctionEmbed|visit_url}} | ||
+ | |||
+ | <pre>{{FunctionEmbed|visit_url|desc=yes}}</pre> | ||
+ | |||
+ | {{FunctionEmbed|visit_url|desc=yes}} | ||
</noinclude> | </noinclude> |
Revision as of 12:28, 20 December 2020
Generates a brief description of a function's signature(s). Used to embed function signatures in function list pages.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Function page name | 1 | Must be a new-style function page | Page | required |
Show function descriptions? | desc | If "yes", also show function descriptions. | Line | optional |
Examples
{{FunctionEmbed|visit_url}}
{{FunctionEmbed|visit_url|desc=yes}}