မာတိကာသို့ ခုန်သွားရန်

မဝ်ဂျူ:unsubst/doc

နူ ဝိက်ရှေန်နရဳ

This is the documentation page for မဝ်ဂျူ:unsubst

This module protects templates and modules from being wrongly substituted.

First, put the following at the beginning of the entry_point function in the module:

if mw.isSubsting() then
	return require('Module:unsubst').unsubst_template("entry_point")
end

Where "entry_point" should be replaced with the function name. Next, edit the template:

{{safesubst:<noinclude/>#invoke:...|entry_point|...}}

The Lua error in မဝ်ဂျူ:template_parser/templates at line 80: Parameter 2 is not used by this template.. is optional. The template will substitute into its transcluded form.

To protect the module itself instead of the template, add this at the start of the function instead:

if mw.isSubsting() then
	return require('Module:unsubst').unsubst_module("entry_point")
end

Directly in templates

[ပလေဝ်ဒါန်]

You can wrap the template code in

{{safesubst:#invoke:unsubst|me|=
...
}}

It will work just like unsubst_template above, apart from also generating a transclusion to Module:unsubst. Additionally, it protects templates from being copied and pasted to non-template pages.