Difference between revisions of "Module:Module wikitext"
Jump to navigation
Jump to search
blackwiki>Jackmcbarn (create a stub module with a function meant to be overwritten by other modules) |
blackwiki>Jackmcbarn (add a _setText helper) |
||
| Line 2: | Line 2: | ||
function p.main(frame) | function p.main(frame) | ||
| + | end | ||
| + | |||
| + | function p._setText(text) | ||
| + | p.main = function(frame) return text end | ||
end | end | ||
return p | return p | ||
Revision as of 17:17, 7 September 2020
Usage
This is an auxiliary module used to allow module pages to display wikitext. Use it by setting this module's text value to whatever content you want to display. The _addText helper method may be useful. For example, to tag a module with {{db-g7}}, put require('Module:Module wikitext')._addText('{{db-g7}}') at the top of it.
local p = {}
function p.main(frame)
end
function p._setText(text)
p.main = function(frame) return text end
end
return p