localp={}--[[mainThis function returns the either the first argument or second argument passed to this module, depending on whether it is being previewed.Usage:{{#invoke:If preview|main|value_if_preview|value_if_not_preview}}]]functionp.main(frame)localresult=''Preview_mode=frame:preprocess('{{REVISIONID}}');-- use magic word to get revision idifnot(Preview_mode==nilorPreview_mode=='')then-- if there is a value then this is not a preiviewresult=frame.args[2]or'';elseresult=frame.args[1]or'';-- no value (nil or empty string) so this is a previewendreturnresultend--[[pmainThis function returns the either the first argument or second argument passed to this module's parent (i.e. template using this module), depending on whether it is being previewed.Usage:{{#invoke:If preview|pmain}}]]functionp.pmain(frame)localparent=frame.getParent(frame)localresult=''Preview_mode=frame:preprocess('{{REVISIONID}}');-- use magic word to get revision idifnot(Preview_mode==nilorPreview_mode=='')then-- if there is a value then this is not a preiviewresult=parent.args[2]elseresult=parent.args[1];-- no value (nil or empty string) so this is a previewendreturnresultend--[[booleanThis function returns the either true or false, depending on whether it is being previewed.Usage:{{#invoke:If preview|boolean}}]]functionp.boolean(frame)localresult=''Preview_mode=frame:preprocess('{{REVISIONID}}');-- use magic word to get revision idifnot(Preview_mode==nilorPreview_mode=='')then-- if there is a value then this is not a preiviewresult=false;elseresult=true;-- no value (nil or empty string) so this is a previewendreturnresultendreturnp