Module:SourceWiki

From imedwiki
Jump to navigation Jump to search

Documentation for this module may be created at Module:SourceWiki/doc

local p = {}
function p.basis(frame)
	local title, text
	title = mw.title.getCurrentTitle()
	local delnote = ''
	local del = false
	local args = frame.args
	if (args['deleted'] and (args['deleted']==1 or args['deleted']=='true'))
	    then
	    	del = true
		end
	if (del)
		then
			delnote="deleted "
		end
	if (title.nsText == "Template")
	then
		text = 'This template is based (in parts) on the '.. delnote
	elseif (title.nsText == "Category")
	then
		if (del)
		then
			delnote="the deleted "
		end
		text = 'This Category is based (in parts) on the '.. delnote
	elseif (title.nsText == "Module")
	then
		if (del)
		then
			delnote="the deleted "
		end
		text = 'This module (and the documentation) are based (partially) on '.. delnote
	else
		text = 'This article is based (in parts) on the '.. delnote ..'article '
    end
    return text
end

function p.revision(frame)
    local text, lframe
    lframe = mw.getCurrentFrame()
    text = lframe:preprocess( "{{REVISIONID}}" )
    return text
end

return p