Dokumentation für das Modul Note[Ansicht] [Bearbeiten] [Versionsgeschichte] [Aktualisieren]

Verwendung

Das Modul wird direkt von der Vorlage {{Anmerkung}} aufgerufen. Parameterbeschreibung siehe dort.

Versionsbezeichnung auf Wikidata: 2021-08-29 Ok!

Benötigte weitere Module

Dieses Modul benötigt folgende weitere Module: Note/i18n
Hinweise
-- adding a type to a reference  -- module import local ni = require( 'Module:Note/i18n' )  -- module variable local nt = { 	-- administration 	moduleInterface = { 		suite  = 'Note', 		serial = '2021-08-29', 		item   = 108306205 	} }  -- check if arg is set: not nil or empty local function isSet( arg ) 	return arg and arg ~= ''; end  local errorMsgs = {}  -- add error message to errorMsgs table local function addErrorMsg( msg ) 	table.insert( errorMsgs, msg ) end  -- get errorMsgs table as string local function getErrorMsgs() 	local result = table.concat( errorMsgs, ' ' ) 	if result ~= '' then 		result = result .. ' ' 	end 	return result end  -- check for possible arguments against list table local function checkArgs( frameArgs, list ) 	local complete = {} 	local args = {}  	for key, value in pairs( list ) do 		if type( value ) == 'table' then 			for _, value2 in ipairs( value ) do 				complete[ value2 ] = key 			end 		elseif value ~= '' then 			complete[ value ] = key 		else 			complete[ key ] = key 		end 	end  	local unknownArgs = false 	local duplicateArgs = false 	for key, value in pairs( frameArgs ) do 		if complete[ key ] then 			if args[ key ] then 				duplicateArgs = true 			end 			-- frameArgs[ key ] cannot be nil 			args[ complete[ key ] ] = mw.text.trim( frameArgs[ key ] ) 		else 			unknownArgs = true 		end 	end 	if unknownArgs then 		addErrorMsg( ni.maintenance.unknownArgs ) 	end 	if duplicateArgs then 		addErrorMsg( ni.maintenance.duplicateArgs ) 	end  	return args end  local function checkType( aType ) 	if not isSet( aType ) then 		return nil 	end  	if ni.types[ aType ] then 		return aType 	end 	for key, value in pairs( ni.types ) do 		if type( value ) == 'table' then 			for _, value2 in ipairs( value ) do 				if aType == value2 then 					return key 				end 			end 		elseif value ~= '' and aType == value then 			return key 		end 	end  	addErrorMsg( ni.maintenance.unknownType ) 	return nil end  function nt.note( frame ) 	local args = checkArgs( frame:getParent().args, ni.args )  	args.type = checkType( args.type ) or ni.defaultType 	if not isSet( args.text ) then 		args.text = ni.maintenance.missingText 	end  	return tostring( mw.html.create( 'cite' ) 		:attr( 'class', ni.citeClass .. ' ' .. args.type ) 		:wikitext( args.text ) 	) .. getErrorMsgs() end  return nt