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

Content deleted Content added
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..."
 
Xqbot (kjak | íkøst)
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:
 
<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".
Linja 26:
 
; 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>
Linja 35:
 
; 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>
Linja 44:
 
; 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>