Module:Sandbox/Ahecht/Cite DNV

This is an old revision of this page, as edited by Ahecht (talk | contribs) at 14:42, 17 May 2016 (create draft). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
local p = {}
local htmlerror = require('Module:Error').error

function p.citednv(frame)
	local origArgs = frame:getParent().args
	local args = {}
	for k, v in pairs(origArgs) do
		args[k] = v
	end

	return '{{cite ship register|register=DNV|id='..string.match(args['url'],'[Vv][Ee][Ss][Ss][Ee][Ll][Ii][Dd]=([Gg]?%d+)')..'|shipname='..(string.match(args['title'],'\'\'(.-)\'\'') or args['title'])..'|accessdate='..((args['accessdate'] or args['access-date']) or '')
end

return p