Module:Protect/doc: Difference between revisions

Content deleted Content added
Come on, a module usedo n 200,000 pages and in system messages is clearly not alpha
Rv; this is the English Wikipedia, not the Turkish Wikipedia
 
(3 intermediate revisions by 2 users not shown)
Line 4:
 
== Usage ==
<syntaxhighlight lang="lua">
 
local protect = require('Module:Protect')
local protectedFunc = '''protect(''func'', ''errFormat'', ''options'')'''
</syntaxhighlight>
 
=== Arguments ===
 
Line 26:
 
== Example ==
<syntaxhighlight lang="lua">
local protect = require('Module:Protect')
 
local protectp = require('Module:Protect'){}
 
function p.main(frame)
local p = {}
if not frame.args[1] then
error('missing argument')
function p.main(frame)
end
if not frame.args[1] then
return frame.args[1]
error('missing argument')
end
 
return frame.args[1]
p.main = '''protect'''(p.main)
end
p.main = '''protect'''(p.main)
return p
 
return p
</syntaxhighlight>
Invoking the main function without arguments will output: <strong class="error">Error: missing argument</strong>
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |