Munurin millum rættingarnar hjá "Module:Cat main/doc"
Content deleted Content added
EileenSanda (kjak | íkøst) Stovnaði síðu við "This module produces hatnote saying "The main article for this category is x." It implements the {{tl|cat main}} template. == Use from wikitext == This module should usu..." |
s Bot: Erstatt forældet <source> -tag og parameteren "enclose" [https://lists.wikimedia.org/pipermail/wikitech-ambassadors/2020-April/002284.html] |
||
Linja 9:
Load the module:
<
local mCatMain = require('Module:Cat main')
</syntaxhighlight>
You can then use the _catMain function like this:
<
mCatMain._catMain(options, ...)
</syntaxhighlight>
<var>options</var> is an optional table that can be used to configure the function's output. There are two available options, "article" and "selfref".
Linja 26:
; Example 1
<
mCatMain._catMain(nil, 'Foo')
</syntaxhighlight>
Produces:
:<code><nowiki><div class="hatnote relarticle mainarticle">The main article for this [[Help:Categories|category]] is '''[[Foo]]'''.</div></nowiki></code>
Linja 35:
; Example 2
<
mCatMain._catMain(nil, 'Foo', 'Bar', 'Baz')
</syntaxhighlight>
Produces:
:<code><nowiki><div class="hatnote relarticle mainarticle">The main articles for this [[Help:Categories|category]] are '''[[Foo]]''', '''[[Bar]]''' and '''[[Baz]]'''.</div></nowiki></code>
Linja 44:
; Example 3
<
mCatMain._catMain({article = false}, 'Foo')
</syntaxhighlight>
Produces:
:<code><nowiki><div class="hatnote relarticle mainarticle">The main page for this [[Help:Categories|category]] is '''[[Foo]]'''.</div></nowiki></code>
|