Module:Module wikitext: Difference between revisions

From wikilawschool.net. Wiki Law School does not provide legal advice. For educational purposes only.
wikipedia>Ymblanter
m (Protected "Module:Module wikitext": Highly visible template: request at WP:RFPP ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite)))
 
m (1 revision imported: Import template and module pages from wikipedia)
 
(No difference)

Latest revision as of 03:35, December 11, 2023

Usage[edit source]

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