Difference between revisions of "Module:Module wikitext"
Jump to navigation
Jump to search
blackwiki>Jackmcbarn (no frame - probably won't be called with one most of the time) |
m (7 revisions imported) |
||
| (4 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
local p = {} | local p = {} | ||
| + | |||
| + | p.text = '' | ||
function p.main() | function p.main() | ||
| + | return p.text | ||
end | end | ||
| − | function p. | + | function p._addText(text, preprocessFrame) |
| − | + | if preprocessFrame ~= false then | |
| + | text = (preprocessFrame or mw.getCurrentFrame()):preprocess(text) | ||
| + | end | ||
| + | p.text = p.text .. text | ||
end | end | ||
return p | return p | ||
Latest revision as of 08:01, 27 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 = {}
p.text = ''
function p.main()
return p.text
end
function p._addText(text, preprocessFrame)
if preprocessFrame ~= false then
text = (preprocessFrame or mw.getCurrentFrame()):preprocess(text)
end
p.text = p.text .. text
end
return p