Munurin millum rættingarnar hjá "Module:TOC/doc"
EileenSanda (kjak | íkøst) Stovnaði síðu við "This module implements various table of contents (TOC) templates. At the moment, it implements {{tl|TOCyears}} and {{tl|List TOC}}. == Usage == === Avaiable fu..." |
s Bot: Erstatt forældet <source> -tag og parameteren "enclose" [https://lists.wikimedia.org/pipermail/wikitech-ambassadors/2020-April/002284.html] |
||
Linja 31: | Linja 31: | ||
Load the module like this: |
Load the module like this: |
||
< |
<syntaxhighlight lang="lua"> |
||
local mTOC = require('Module:TOC') |
local mTOC = require('Module:TOC') |
||
</syntaxhighlight> |
|||
</source> |
|||
You can then use the functions with the following syntax: |
You can then use the functions with the following syntax: |
||
< |
<syntaxhighlight lang="lua"> |
||
mTOC.func(args) |
mTOC.func(args) |
||
</syntaxhighlight> |
|||
</source> |
|||
"func" should be changed to one of the Lua function names in the table above. These all start with an underscore ("_"). The <var>args</var> variable is a table of arguments to be passed to the function. Please see the template documentation for available arguments. |
"func" should be changed to one of the Lua function names in the table above. These all start with an underscore ("_"). The <var>args</var> variable is a table of arguments to be passed to the function. Please see the template documentation for available arguments. |
Seinasta endurskoðan sum var 22. apr 2020 kl. 16:39
This module implements various table of contents (TOC) templates. At the moment, it implements {{TOCyears}} and {{List TOC}}.
Usage[rætta wikitekst]
Avaiable functions[rætta wikitekst]
#invoke function | Lua function | Template |
---|---|---|
years | _years | {{TOCyears}} |
list | _list | {{List TOC}} |
From wikitext[rætta wikitekst]
From wikitext this module should usually be used through one of the templates in the table above. However, it is also possible to use it with the following syntax:
{{#invoke:TOC|function|args}}
The function names are listed in the table in the "#invoke function" column, and args are the arguments that would normally be added by the template. Please see the template documentation for each template for available parameters.
From Lua[rætta wikitekst]
Load the module like this:
local mTOC = require('Module:TOC')
You can then use the functions with the following syntax:
mTOC.func(args)
"func" should be changed to one of the Lua function names in the table above. These all start with an underscore ("_"). The args variable is a table of arguments to be passed to the function. Please see the template documentation for available arguments.