Module:Module wikitext

MyWikiBiz, Author Your Legacy — Wednesday November 13, 2024
Revision as of 05:00, 16 July 2021 by Zoran (talk | contribs) (Pywikibot 6.4.0)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Template:Twinkle standard installation

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 <syntaxhighlight lang="lua" inline>require('Module:Module wikitext')._addText('Template:Db-g7')</syntaxhighlight> 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