Difference between revisions of "Module:DYK nompage links/doc"

From blackwiki
Jump to navigation Jump to search
blackwiki>Mr. Stradivarius
(create)
 
m (2 revisions imported)
 
(One intermediate revision by one other user not shown)
Line 9: Line 9:
 
To use this module from other Lua modules, first load the module:
 
To use this module from other Lua modules, first load the module:
  
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
local mDYKlinks = require('Module:DYK nompage links')
 
local mDYKlinks = require('Module:DYK nompage links')
</source>
+
</syntaxhighlight>
  
 
You can then use the _main function like this:
 
You can then use the _main function like this:
  
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
mDYKlinks._main(nominationPage, historyPages)
 
mDYKlinks._main(nominationPage, historyPages)
</source>
+
</syntaxhighlight>
  
 
<var>nominationPage</var> is the nomination page name, as a string. <var>historyPages</var> is an array of page names to display (also strings). Both parameters are required, and <var>historyPages</var> must have a length of at least one.
 
<var>nominationPage</var> is the nomination page name, as a string. <var>historyPages</var> is an array of page names to display (also strings). Both parameters are required, and <var>historyPages</var> must have a length of at least one.

Latest revision as of 16:01, 26 September 2020

This module produces the list of links used on Wikipedia:Did you know nomination pages. It implements {{DYK nompage links}}.

Usage from wikitext

Usually, this module should be used via the {{DYK nompage links}} template. However, it can also be used with the syntax {{#invoke:DYK nompage links|main|arguments}}. See Template:DYK nompage links for a list of arguments.

Usage from other Lua modules

To use this module from other Lua modules, first load the module:

local mDYKlinks = require('Module:DYK nompage links')

You can then use the _main function like this:

mDYKlinks._main(nominationPage, historyPages)

nominationPage is the nomination page name, as a string. historyPages is an array of page names to display (also strings). Both parameters are required, and historyPages must have a length of at least one.