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

Funktion

Der Modul verlinkt eine kommaseparierte Liste von ISB-Nummern mit eingeklammerten Kommentaren. Der Aufruf erfolgt über die Vorlage {{ISBN}}.

Versionsbezeichnung auf Wikidata: 2024-10-24 Ok!

Benötigte weitere Module

Dieses Modul benötigt folgende weitere Module: Check isxn • Link utilities • Link utilities/i18n • Yesno

Verwendung in anderen Modulen

Dieses Modul ist notwendig für die Ausführung folgender Module. Bei Anpassungen sollte die Funktionstüchtigkeit der folgenden Module geprüft werden. Benutze dazu auch diese Tracking-Kategorie um Fehler zu finden, die sich dann auf Artikel auswirken:

Hinweise
-- module interface local LinkISBN = { 	suite  = 'LinkISBN', 	serial = '2024-10-24', 	item   = 65157187 }  -- module import local ci = require( 'Module:Check_isxn' ) local lb = require( 'Module:Link utilities/i18n' ) local lu = require( 'Module:Link utilities' ) local yn = require( 'Module:Yesno' )  -- module variable and administration local li = { 	moduleInterface = LinkISBN }  -- link a single ISBN function li._linkISBN( isbn, ignoreError, demo ) 	isbn = mw.text.trim( isbn ) 	if isbn == '' then 		return isbn 	end  	local comment = '' 	isbn, comment = lu.extractComment( isbn )  	isbn = isbn:gsub( 'ISBN *', '' ):upper() -- x -> X 	local t = '<span class="%s">[[Special:Booksources/%s|ISBN <span class="%s">%s</span>]]</span>' 	t = t:format( lb.isbnTexts.booksourcesClass, isbn, lb.isbnTexts.isbnClass, isbn ) 	if not ignoreError then 		t = t .. ci._check_isbn( isbn, 			lb.isbnTexts.invalidISBN .. ( demo and '' or lb.isbnTexts.invalidCat ) ) 	end 	if comment ~= '' then 		t = t .. ' ' .. comment 	end 	return t end  -- link a list of several ISBNs function li._linkISBNSet( args ) 	args.isbn = args.isbn or args[ 1 ] or '' 	if args.isbn == '' then 		return '' 	end  	args.ignoreError = yn( args.ignoreError or args.noerror, false )  	local ns     = mw.title.getCurrentTitle().namespace 	local isDemo = ns == 10 or ns == 828  	-- split separate ISBNs 	local items = lu.splitItems( args.isbn, lb.delimiters ) 		 	-- analyse ISBNs 	local result = '' 	local s 	for i, item in ipairs( items ) do 		s = li._linkISBN( item, args.ignoreError, isDemo ) 		if s ~= '' then 			result = ( result ~= '' and result .. ', ' or '' ) .. s 		end 	end 	return result end  function li.linkISBNs( frame ) 	return li._linkISBNSet( frame:getParent().args ) end  return li