Munurin millum rættingarnar hjá "Module:Cat main/doc"

90 bytes løgd afturat ,  7 mánaðir síðan
s
Bot: Erstatt forældet <source> -tag og parameteren "enclose" [https://lists.wikimedia.org/pipermail/wikitech-ambassadors/2020-April/002284.html]
(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])
 
Load the module:
 
<sourcesyntaxhighlight lang="lua">
local mCatMain = require('Module:Cat main')
</syntaxhighlight>
</source>
 
You can then use the _catMain function like this:
 
<sourcesyntaxhighlight lang="lua">
mCatMain._catMain(options, ...)
</syntaxhighlight>
</source>
 
<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".
 
; Example 1
<sourcesyntaxhighlight lang="lua">
mCatMain._catMain(nil, 'Foo')
</syntaxhighlight>
</source>
Produces:
:<code><nowiki><div class="hatnote relarticle mainarticle">The main article for this [[Help:Categories|category]] is '''[[Foo]]'''.</div></nowiki></code>
 
; Example 2
<sourcesyntaxhighlight lang="lua">
mCatMain._catMain(nil, 'Foo', 'Bar', 'Baz')
</syntaxhighlight>
</source>
Produces:
:<code><nowiki><div class="hatnote relarticle mainarticle">The main articles for this [[Help:Categories|category]] are '''[[Foo]]''', '''[[Bar]]''' and '''[[Baz]]'''.</div></nowiki></code>
 
; Example 3
<sourcesyntaxhighlight lang="lua">
mCatMain._catMain({article = false}, 'Foo')
</syntaxhighlight>
</source>
Produces:
:<code><nowiki><div class="hatnote relarticle mainarticle">The main page for this [[Help:Categories|category]] is '''[[Foo]]'''.</div></nowiki></code>
14.816

rættingar