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

Frá Wikipedia, hin frælsa alfrøðin
Content deleted Content added
Stovnaði síðu við "This module produces a "for more details on this topic" link. It implements the {{tl|details}} template. == Use from wikitext == This module cannot be used directly from..."
 
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: Linja 9:
Load the module:
Load the module:


<source lang="lua">
<syntaxhighlight lang="lua">
local mDetails = require('Module:Details')
local mDetails = require('Module:Details')
</syntaxhighlight>
</source>


You can then use the _details function like this:
You can then use the _details function like this:


<source lang="lua">
<syntaxhighlight lang="lua">
mDetails._details(page, topic, options)
mDetails._details(page, topic, options)
</syntaxhighlight>
</source>


The <var>page</var> variable is the page to be linked to, and is required. The page name can include a section link if desired. If the page includes a section link, it is automatically formatted as ''page § section'', rather than the MediaWiki default of ''page#section''.
The <var>page</var> variable is the page to be linked to, and is required. The page name can include a section link if desired. If the page includes a section link, it is automatically formatted as ''page § section'', rather than the MediaWiki default of ''page#section''.
Linja 26: Linja 26:


; Example 1
; Example 1
<source lang="lua">
<syntaxhighlight lang="lua">
mDetails._details('Carbon dioxide data')
mDetails._details('Carbon dioxide data')
</syntaxhighlight>
</source>
Produces:
Produces:
:<code><nowiki><div class="hatnote boilerplate seealso">For more details on this topic, see [[Carbon dioxide data]].</div></nowiki></code>
:<code><nowiki><div class="hatnote boilerplate seealso">For more details on this topic, see [[Carbon dioxide data]].</div></nowiki></code>
Linja 35: Linja 35:


; Example 2
; Example 2
<source lang="lua">
<syntaxhighlight lang="lua">
mDetails._details('Carbon dioxide data', 'the physical properties of carbon dioxide')
mDetails._details('Carbon dioxide data', 'the physical properties of carbon dioxide')
</syntaxhighlight>
</source>
Produces:
Produces:
:<code><nowiki><div class="hatnote boilerplate seealso">For more details on the physical properties of carbon dioxide, see [[Carbon dioxide data]].</div></nowiki></code>
:<code><nowiki><div class="hatnote boilerplate seealso">For more details on the physical properties of carbon dioxide, see [[Carbon dioxide data]].</div></nowiki></code>
Linja 44: Linja 44:


; Example 3
; Example 3
<source lang="lua">
<syntaxhighlight lang="lua">
mDetails._details('Lua programming on Wikipedia', 'Wikipedia:Lua', {selfref = true})
mDetails._details('Lua programming on Wikipedia', 'Wikipedia:Lua', {selfref = true})
</syntaxhighlight>
</source>
Produces:
Produces:
:<code><nowiki><div class="hatnote selfref">For more details on Lua programming on Wikipedia, see [[Wikipedia:Lua]].</div></nowiki></code>
:<code><nowiki><div class="hatnote selfref">For more details on Lua programming on Wikipedia, see [[Wikipedia:Lua]].</div></nowiki></code>

Seinasta endurskoðan sum var 22. apr 2020 kl. 16:37

This module produces a "for more details on this topic" link. It implements the {{details}} template.

Use from wikitext[rætta wikitekst]

This module cannot be used directly from #invoke. Instead, it can only be used through the {{details}} template. Please see the template page for documentation.

Use from other Lua modules[rætta wikitekst]

Load the module:

local mDetails = require('Module:Details')

You can then use the _details function like this:

mDetails._details(page, topic, options)

The page variable is the page to be linked to, and is required. The page name can include a section link if desired. If the page includes a section link, it is automatically formatted as page § section, rather than the MediaWiki default of page#section.

The topic variable is a description of the topic, and is optional. The default topic value is "this topic".

The options table can be used to configure the function's output. At current, the only option available is "selfref", which is used when the output is a self-reference to Wikipedia. to set this option, use

{selfref = true}

. (See the {{selfref}} template for more details on self-references.)

Example 1
mDetails._details('Carbon dioxide data')

Produces:

<div class="hatnote boilerplate seealso">For more details on this topic, see [[Carbon dioxide data]].</div>

Displays as:

For more details on this topic, see Carbon dioxide data.
Example 2
mDetails._details('Carbon dioxide data', 'the physical properties of carbon dioxide')

Produces:

<div class="hatnote boilerplate seealso">For more details on the physical properties of carbon dioxide, see [[Carbon dioxide data]].</div>

Displays as:

For more details on the physical properties of carbon dioxide, see Carbon dioxide data.
Example 3
mDetails._details('Lua programming on Wikipedia', 'Wikipedia:Lua', {selfref = true})

Produces:

<div class="hatnote selfref">For more details on Lua programming on Wikipedia, see [[Wikipedia:Lua]].</div>

Displays as:

For more details on Lua programming on Wikipedia, see Wikipedia:Lua.

Technical details[rætta wikitekst]

This module uses Module:Hatnote to format the hatnote text and Module:Arguments to fetch the arguments from wikitext.