Module:Call wikitext/doc
![]() | This is a documentation subpage for Module:Call wikitext. It may contain usage information, categories and other content that is not part of the original module page. |
{{#invoke:Call wikitext|main}} allows wikitext to be called as if it were part of a template. The contents of the <nowiki>...</nowiki>
tag passed to |sourceCode=
parameter will be called with the other arguments passed to this module.
This module is most useful on the documentation pages of module like Module:For nowiki and Module:ArgRest that require parent frame arguments to function. It was orginally designed for providing an effective way to create testcases for Module:ArgRest.
Usage
{{#invoke:Call wikitext|main|sourceCode=<nowiki>wikitext to call</nowiki>|parameters to call with}}
It is most commonly used with Lua modules like so:
{{#invoke:Call wikitext|main|sourceCode=<nowiki>{{#invoke:module|function|child frame parameters}}</nowiki>|parent frame parameters}}
The |sourceCode=
parameters take the wikitext to call wrapped in <nowiki>...</nowiki>
tags. This parameter is not passed to the wikitext.
Examples
{{#invoke:Call wikitext|main|sourceCode=<nowiki>{{{1}}} {{{foo}}} {{{1}}}</nowiki>|One|foo=Foo}}
→ One Foo One{{#invoke:Call wikitext|main|sourceCode=<nowiki>{{#invoke:ArgRest|main|<nowiki>{{{1}}}! </nowiki>|1}}|One|Two|Three}}</nowiki>
→ One! Two! Three!