Melvor Idle:Contributing: Difference between revisions
From Melvor Idle
m (added template and module description) |
m (formatting) |
||
Line 29: | Line 29: | ||
To access the source page of a template, as for example the Menu template, simply go to the <code>Template:Menu</code> page. Because these pages are templates, they will automatically be imported when referred to, and therefore do not need the prior colon. Otherwise you'd need to prepend a colon to the page name <code><nowiki>{{:Menu}}</nowiki></code> to include its content. | To access the source page of a template, as for example the Menu template, simply go to the <code>Template:Menu</code> page. Because these pages are templates, they will automatically be imported when referred to, and therefore do not need the prior colon. Otherwise you'd need to prepend a colon to the page name <code><nowiki>{{:Menu}}</nowiki></code> to include its content. | ||
Templates furthermore support numeric arguments, referenced in the templates by <code><nowiki>{{{1}}}</nowiki></code>, but also named arguments | Templates furthermore support numeric arguments, referenced in the templates by <code><nowiki>{{{1}}}</nowiki></code>, but also named arguments. | ||
An example of this would be <code><nowiki>{{{text}}}</nowiki></code> for <code><nowiki>{{ItemIcon|Mole|text=A summon}}</nowiki></code>. | |||
Some of the templates are simply wrappers for Lua modules, which will include <code><nowiki>{{#invoke:SomeModule|someFunction}}</nowiki></code>. To access the module source files, simply go to <code><nowiki>Module:SomeModule</nowiki></code>, and look for <code>someFunction</code> in there. | Some of the templates are simply wrappers for Lua modules, which will include <code><nowiki>{{#invoke:SomeModule|someFunction}}</nowiki></code>. To access the module source files, simply go to <code><nowiki>Module:SomeModule</nowiki></code>, and look for <code>someFunction</code> in there. |