Template:funcref

Table of contents
No headers
/* get the page language */
var uri = uri.parts(Page.uri);
var lang = string.tolower(uri.path[0]);
if (string.contains(lang, "project") || string.contains(lang, "Project")) {
  let lang = string.substr(lang, 8);
}
/* fall back to page.language on a user page */
else if (string.StartsWith(lang, "user:")) {
 let lang = page.language;
}
 var link = lang .. '/' .. $0;

if (wiki.pageExists(link)) {
web.link(wiki.uri(link), $0 .. '(' .. ($1 ?? '') .. ')');
} else {
<a href=(link) class="new">($0 .. '(' .. ($1 ?? '') .. ')')</a>
}

See the documentation at MDC:Custom Templates. Some examples:

{{Funcref("MyCoolFunction")}}

{{Funcref("MyCoolFunction", "param1, param2")}}

Tags (0)

Edit tags
  • No tags

Attachments (0)

 

Attach file