Jump to content
šŸ—³ļøšŸ–„ļø The Wikimedia Foundation December 2024 Developer Satisfaction Survey closes on the 2025-01-03. This survey helps us measure developer satisfaction, and prioritize work on tools and platforms for our technical contributors.

Module:Module wikitext

From wikiNonStop
Revision as of 16:22, 14 February 2023 by en>Uzume (copied from w:en:Module:Module wikitext)
(diff) ā† Older revision | Latest revision (diff) | Newer revision ā†’ (diff)
Module documentation

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 {{Delete }}, put require('Module:Module wikitext')._addText('{{delete|reason}}') 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