Module:Preview warning
Appearance
This module is being discussed in accordance with Wikipedia's deletion policy. Help reach a consensus at its entry.
Maintenance use only: 1. Edit the TfD log to create the discussion entry. 2. Please consider notifying the author(s) by placing {{subst:TfD notice|Preview warning|module=yes}} ~~~~ on their talk page(s). |
This module is subject to page protection. It is a highly visible module in use by a very large number of pages, or is substituted very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is protected from editing. |
මෙම Lua module පිටු 16,000 පමණ භාවිතා වන නිසා සිදුකරන වෙනස් කිරීම් බොහෝ ස්ථානවලට බලපානු ඇත. ඔබ සිදුකිරීමට අදහස් කරන වෙනස්කම් මෙම මොඩියුලයට අදාළ /sandbox හෝ /testcases උපපිටු. එම වෙනස්කම් සිදුකිරීමට ප්රථම අදාළ සාකච්ඡා පිටුවේ ඒ පිළිබඳව සංවාදයක් ගොඩනැගීමට කාරුණික වන්න.
Transclusion count updated automatically (ප්රලේඛනය වෙතට යොමුවන්න). |
Usage
[සංස්කරණය]Put this code in your template. The message will only show in Show preview (you can try with this page):
{{#invoke:Preview warning|main|Message text}}
→
local p = {}
--[[
main
This function returns parameter 1 as a warning if the page containing it is being previewed.
Usage:
{{#invoke:Preview warning|main|warning_text}}
]]
function p.main(frame)
local preview = frame.args[1]:match('^%s*(.-)%s*$') or ''
if preview == '' then preview = 'Something is wrong with this template' end
if frame:preprocess( "{{REVISIONID}}" ) == "" then return '<div class="hatnote" style="color:red"><strong>Warning:</strong> ' .. preview .. ' (this message is shown only in preview)</div>' end
end
return p