Module:unsubst/documentation

Hello, you have come here looking for the meaning of the word Module:unsubst/documentation. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:unsubst/documentation, but we will also tell you about its etymology, its characteristics and you will know how to say Module:unsubst/documentation in singular and plural. Everything you need to know about the word Module:unsubst/documentation you have here. The definition of the word Module:unsubst/documentation will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:unsubst/documentation, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

This module protects templates and modules from being wrongly substituted.

Usage

There are two ways to use this module:

Protecting all templates in a module

First, put the following at the top of a module which contains functions designed to be called by {{#invoke:}}:

-- Prevent substitution.
if mw.isSubsting() then
	return require("Module:unsubst")
end

Second, edit each template which calls that module from:

{{#invoke:...|function|...}}

to:

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

Note: this should only be used with modules that only return functions which are designed to be called by templates (not by other modules). If your module also returns functions (or other data) designed to be called by other modules, then the safest solution is to separate out the template functions into a separate module, usually in the format Module:.../templates (e.g. Module:links/templates). This is because it automatically throws an error if it detects that it is not being substituted, and it prevents any functions or data in a module from being accessed during substitution, which will disrupt other modules which need to access those functions while they are being substituted.

In templates

Template code can be wrapped as follows:

{{safesubst:<noinclude/>#invoke:unsubst|me|=
...
}}