Module:Infobox/doc: Difference between revisions

Ganaram inukshuk (talk | contribs)
module is meant to be invoked directly; saying "should not be invoked directly" when it can be is contradictory
Ganaram inukshuk (talk | contribs)
mNo edit summary
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{documentation|
{{documentation|{{dochead|header=metatemplate}}
{{dochead|header='''Note:''' This module may be invoked directly by calling <code>_infobox(args)</code> or by using its corresponding template (Template:Infobox).}}{{lua|arguments|yesno}}
<p>'''Module:Infobox''' is a {{w|wp:lua|module}} that implements the {{tlx|Infobox}} template. Infobox templates can be made by using the template or by calling the <code>_sidebar</code> function from another module.</p>
<p>'''Module:Infobox''' is a {{w|wp:lua|module}} that implements the {{tlx|Infobox}} template. Please see the template page for usage instructions.</p>


On other templates that use or generate infoboxes, you can call <code>_infobox</code> (note the underscore in front). The <code>infobox</code> function (without the underscore) is used by [[Template:Infobox]] as a wrapper.
On templates, you can create an infobox by using <code><nowiki>{{Infobox}}</nowiki></code>, which calls this module's wrapper function.


On other modules, you can include <syntaxhighlight inline lang="lua">local infobox = require("Module:Infobox")._infobox</syntaxhighlight> at or near the top.{{clear}}
On modules, you can include <syntaxhighlight inline lang="lua">local infobox= require("Module:Infobox")._infobox</syntaxhighlight> to create an infobox.{{clear}}
{{module introspection}}
}}
}}