Module:Warning/doc: Difference between revisions
Appearance
Content deleted Content added
Explicitly mentioned Module:Error |
m Removed extra <p> in /doc view |
||
Line 1: | Line 1: | ||
{{Module rating|beta}} |
{{Module rating|beta}} |
||
This module simply unifies the formatting of all warning messages similar to [[Module:Error]]. Currently, it is plain text, but custom formatting may be applied after discussion in the [[Module talk:Warning|talk]] page. Warnings are displayed above the preview when previewing an edit. |
This module simply unifies the formatting of all warning messages similar to [[Module:Error]]. Currently, it is plain text, but custom formatting may be applied after discussion in the [[Module talk:Warning|talk]] page. Warnings are displayed above the preview when previewing an edit. |
||
Line 7: | Line 8: | ||
warn('Message') |
warn('Message') |
||
warn(('Custom %s.'):format(warning)) |
warn(('Custom %s.'):format(warning)) |
||
</syntaxhighlight> |
</syntaxhighlight><includeonly> |
||
{{Sandbox other|| |
{{Sandbox other|| |
||
[[Category:Error-handling modules]] |
[[Category:Error-handling modules]] |
||
}}</includeonly> |
|||
}} |
Revision as of 16:57, 15 July 2021
This module simply unifies the formatting of all warning messages similar to Module:Error. Currently, it is plain text, but custom formatting may be applied after discussion in the talk page. Warnings are displayed above the preview when previewing an edit.
Usage
local warn = require('Module:Warning')
warn('Message')
warn(('Custom %s.'):format(warning))