Jump to content

Module:Warning/doc: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Wrote example with warning class
Added level parameter
Line 6: Line 6:
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
local warn = require('Module:Warning')
local warn = require('Module:Warning')
warn('Message')
warn("Message")
warn(('TypeWarning: %s.'):format(warning))
warn(("TypeWarning: %s"):format(warning), level)
</syntaxhighlight><includeonly>
</syntaxhighlight><includeonly>



Revision as of 23:46, 18 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(("TypeWarning: %s"):format(warning), level)