Zum Inhalt springen

„Modul:Zeichen“ – Versionsunterschied

aus Wikipedia, der freien Enzyklopädie
[gesichtete Version][gesichtete Version]
Inhalt gelöscht Inhalt hinzugefügt
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
 
(35 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 4: Zeile 4:
Author: Vollbracht
Author: Vollbracht
* data() Wikidata information for current sign in table form
* data() Wikidata information for current sign in table form
* short() Sitelink (or Label) + codepoint by Wikidata qualifier (pair of td)
* byQ() data for a list of signs (not unicode representations!) given by
* byQ() data for a list of signs (not unicode representations!) given by
Wikidata qualifiers
Wikidata qualifiers
Zeile 13: Zeile 12:


local _, Parser = pcall(require, "Modul:SimpleStruct")
local _, Parser = pcall(require, "Modul:SimpleStruct")
local _, Limited = pcall(require, "Modul:SimpleDataAccess")

local _, SequenceMod = pcall(require, "Modul:Zeichenfolge")
--[[
local Sequence = SequenceMod.service
altParse
alternative Parser for strictly limited string parameters
StringPar string in Format
<Label1>{<value1>}
<Label2>{<value2>}
<Label3>{<value3>}
returns table ordered by input positions
{{<Label1>, <value1>}, {<Label2>, <value2>}, {<Label3>, <value3>}}
where Parser.parse would return table without order
{<Label1>{<value1>}, <Label2>{<value2>}, <Label3>{<value3>}}
]]
local altParse = function(StringPar)
local result = {}
local tabR = mw.text.split(StringPar, '}')
if string.gsub(tabR[#tabR], '^%s*(.-)%s*$', '%1') == '' then
tabR[#tabR] = nil
end
for i, elmR in ipairs(tabR) do
local tabL = mw.text.split(elmR, '{')
if #tabL ~= 2 then
table.insert(result, {"Fehler", "Bitte hier nur Elemente im Format <label>{<Wert>} eintragen! [[Kategorie:Wikipedia:Qualitätssicherung Vorlageneinbindung fehlerhaft]] "})
else
table.insert(result,
{string.gsub(tabL[1], '^%s*(.-)%s*$', '%1'),
string.gsub(tabL[2], '^%s*(.-)%s*$', '%1')})
end
end
return result
end

--[[
mainsnak value
returns the first value of a property for a given qualifier
If value is a table it is assumed to contain another qualifier and its
label is returned. Otherwise the value itself is returned
]]
local MSValue = function(qualifier, property)
local statementList = mw.wikibase.getBestStatements(qualifier, property)
if statementList[1] == nil then return "" end
local result = statementList[1]["mainsnak"]["datavalue"]["value"]
if type(result) == 'table' then
if result["id"] then return mw.wikibase.getLabel(result["id"]) end
return ""
end
return result
end

--[[
ucp(qual)
returns unicode codepoint for a Wikidata sign object pointing to one or more
Wikidata unicode objects given by a Wikidata Qualifier string like "Q1234"
given in qual.
]]
local ucp = function(qual)
local uniQraw = mw.wikibase.getBestStatements(qual, "P1299")
if uniQraw[1] then
local unicodeQ = uniQraw[1]["mainsnak"]["datavalue"]["value"]["id"]
return MSValue(unicodeQ, "P4213")
end
return ""
end

--[[
short(qual)
returns a table of two elements:
1. Sitelink (or Label if Sitelink unavailable)
2. unicode codepoint or table of unicode codepoints
]]
p.service.short = function(qual)
local rawChar = mw.wikibase.getSitelink(qual)
if rawChar == nil then
rawChar = mw.wikibase.getLabel(qual)
end
if rawChar == nil then
return {"Fehler", "20; Bitte nur für Zeichenbeschreibung mit Wikidata einsetzen! [[Kategorie:Wikipedia:Qualitätssicherung Vorlageneinbindung fehlerhaft]] "}
end
local codepoint = ucp(qual)
if codepoint == "" then
-- Todo: sequences to be handled here!
return {rawChar, "0020"}
end
return {rawChar, codepoint}
end

--[[
{{Zeichen|short|qual|charStyle}}
returns a set of 2 <td> elements containing Sitelink or Label and character
or characters defined by <qual>
]]
p.short = function(qual, charStyle)
local raw = p.service.short(qual)
local chS = charStyle
if chS == nil then chS = "" end
if type(raw[2]) == "string" then
local result = "<td " .. chS .. ">&#x" .. raw[2] .. ";</td>"
return result .. "<td>[[" .. raw[1] .. "]]</td>"
end
return '<td colspan="2">Fehler: Bitte nur für Zeichenbeschreibung mit Wikidata einsetzen! [[Kategorie:Wikipedia:Qualitätssicherung Vorlageneinbindung fehlerhaft]]</td>'
end

--[[
shortList(qList, charStyle)
returns a table of 2 columns of short(qual, charStyle) listing all
occurences of Wikidata qualifiers within qList string currently devided by
an additional empty column
]]
local shortList = function(qList, charStyle)
local list = {}
for qual in qList:gmatch('[qQ]%d+') do
table.insert(list, p.short(qual, charStyle))
end
if list[1] == nil then
return ""
end
local delims = {
'</tr><tr>',
'<td>&nbsp;</td>',
'',
'<td>&nbsp;</td><td></td><td></td>'
}
local result = '<table style="width:100%;"><tr>'
for i, v in ipairs(list) do
result = result .. v
if i == #list then
result = result .. delims[i%2+3]
else
result = result .. delims[i%2+1]
end
end
return result .. '</tr></table>'
end

--[[
listOfShortLists(structureCode)
returns a structure of pairs of list labels and list data strings
structureCode may be:
list of character qualifiers:
Q1234 Q4567 Q7891
labels altering with qualifier lists
{label row} {label row} {Q1234 Q4567 Q7891}
{label row} {Q1234 Q4567 Q7891}
pairs of label and list where label may be given by qualifier
{{Q147}, {Q1234 Q4567 Q7891}}
{{Q258}, {Q1234 Q4567 Q7891}}
{{label},{Q1234 Q4567 Q7891}}
lists with labels (unpredictable order of lists; however each list is
inernally ordered predictably)
label1{Q1234 Q4567 Q7891}
label2{Q1234 Q4567 Q7891}
result is a list
{
{label, "Q1234 Q4567 Q7891"},
{label, "Q1234 Q4567 Q7891"},
{label, "Q1234 Q4567 Q7891"}
}
wherein label may be empty.
]]
p.service.listOfShortLists = function(structureCode)
local lists = Parser.parse(structureCode)
if lists[1] == structureCode then
return {{"", structureCode}}
end
local result = {}
local head = ""
for i, pair in ipairs(lists) do
t = type(pair) -- should be {{label} {list}}
if t == "string" then
-- handle {label row} and {list} elements (preffered syntax)
if pair:find('[qQ]%d+') == nil then
if head == "" then
head = pair
else
head = head .. '<br />' .. pair
end
else
table.insert(result, {head, pair}) mw.log('155')
head = ""
end
elseif t == "table" then
if pair[1] == nil then
-- handle table of label{list} elements (no preffered syntax)
for label, list in pairs(pair) do
table.insert(result, {label, list})
end
else
-- handle {{label} {list}} elements
local labelQ = pair[1]:match('[qQ]%d+')
if labelQ == "" then
table.insert(result, pair)
else
table.insert(result, {mw.wikibase.getLabel(labelQ), pair[2]})
end
end
end
end
return result
end

--[[
{{Zeichen|listOfShortLists|
structureCode| tableStyles| thStyles| charStyles)}}
]]
local LoSlCore = function(structureCode, thStyles, charStyles)
if structureCode == nil then return "" end
local source = p.service.listOfShortLists(structureCode)
local thS = thStyles
if thS == nil then thS = "" end
local chS = charStyles
if chS == nil then thS = "" end
if #source == 0 then return "" end
local result = ""
mw.logObject(source)
for i, pair in ipairs(source) do
mw.log('191 Element ' .. i)
mw.logObject(pair)
if pair[1] ~= "" then
result = result .. '<tr><th colspan="2" ' .. thS .. '>'
result = result .. pair[1] .. '</th></tr>'
end
result = result .. '<tr><td colspan="2">'
result = result .. shortList(pair[2], chS) .. '</td></tr>'
end
return result
end

-- now surround this for export:
p.listOfShortLists = function(structureCode, tableStyles, thStyles, charStyles)
local source = p.service.listOfShortLists(structureCode)
local core = LoSlCore(structureCode, thStyles, charStyles)
if core == "" then return "" end
return '<table ' .. tableStyles .. '>' .. core .. '</table>'
end


--[[
--[[
Zeile 272: Zeile 40:
else
else
local unicodeQ = uniQraw[1]["mainsnak"]["datavalue"]["value"]["id"]
local unicodeQ = uniQraw[1]["mainsnak"]["datavalue"]["value"]["id"]
result.block = MSValue(unicodeQ, "P5522")
result.block = Limited.MainSnackValue(unicodeQ, "P5522")
result.name = MSValue(unicodeQ, "P9382")
result.name = Limited.MainSnackValue(unicodeQ, "P9382")
result.code = MSValue(unicodeQ, "P4213")
result.code = Limited.MainSnackValue(unicodeQ, "P4213")
end
end
return result
return result
Zeile 295: Zeile 63:
Zeichenkette nach dem Schema 'class="<Liste>" style="<styles>"'
Zeichenkette nach dem Schema 'class="<Liste>" style="<styles>"'
optional, default: 'style="font-size:250%;"'
optional, default: 'style="font-size:250%;"'
charPrefix=<string>
Zeichenkette, die jedem Zeichen vorangestellt werden soll
optional, default: ''
Bsp (für Akzente): charPrefix=&#x25CC;
addRows=<Liste>
addRows=<Liste>
eine Liste von zusätzlichen Zeilen nach dem Schema
eine Liste von zusätzlichen Zeilen nach dem Schema
Zeile 312: Zeile 84:
if frame.args.charStyles then
if frame.args.charStyles then
charStyles = frame.args.charStyles
charStyles = frame.args.charStyles
end
end mw.log('282 OK')
local charPref = ''
local list = LoSlCore(frame.args.addList, frame.args.thStyles, charStyles)
if frame.args.charPrefix then
charPref = frame.args.charPrefix
end
local list = Sequence.listOfShortListsCore(
frame.args.addList, frame.args.thStyles, charStyles)
if frame.args.tableStyles then
if frame.args.tableStyles then
result = result .. frame.args.tableStyles
result = result .. frame.args.tableStyles
Zeile 337: Zeile 114:
else
else
result = result .. '<td style="vertical-align: middle;">Zeichen:</td>'
result = result .. '<td style="vertical-align: middle;">Zeichen:</td>'
result = result .. '<td ' .. charStyles .. '>&#x' .. source.code .. ';'
result = result .. '<td><span ' .. charStyles .. '>'
result = result .. '</td></tr><tr><td>Codepunkt:</td>'
result = result .. charPref .. '&#x' .. source.code
result = result .. ';</span></td></tr><tr><td>Codepunkt:</td>'
result = result .. '<td>U+' .. source.code
result = result .. '<td>U+' .. source.code
result = result .. '</td></tr><tr><td>Unicode-Name:</td><td>'
result = result .. '</td></tr><tr><td>Unicode-Name:</td><td>'
Zeile 347: Zeile 125:
result = result .. '</td></tr>'
result = result .. '</td></tr>'
if frame.args.addRows then
if frame.args.addRows then
local rows = altParse(frame.args.addRows)
local rows = Parser.altParse(frame.args.addRows)
if rows ~= nil then
if rows ~= nil then
for _, v in ipairs(rows) do
for _, v in ipairs(rows) do
Zeile 369: Zeile 147:
result = result .. '</table>'
result = result .. '</table>'
return result
return result
end

p.service.unicode = function(Qualifier)
local qual = Qualifier:match('[qQ]%d+')
local result = {}
if qual then
result.label = mw.wikibase.getSitelink(qual)
if result.label == nil then
result.label = mw.wikibase.getLabel(qual)
end
result.description = mw.wikibase.getDescription(qual)
local uniQraw = mw.wikibase.getBestStatements(qual, "P1299")
if uniQraw[1] then
local unicodeQ = uniQraw[1]["mainsnak"]["datavalue"]["value"]["id"]
result.block = Limited.MainSnackValue(unicodeQ, "P5522")
result.name = Limited.MainSnackValue(unicodeQ, "P9382")
result.code = Limited.MainSnackValue(unicodeQ, "P4213")
else
result.block = ""
result.name = ""
result.code = ""
end
return result
else
return nil
end
end
end


Zeile 382: Zeile 186:
]]
]]
p.service.byQ = function(QualifierList)
p.service.byQ = function(QualifierList)
local qualifiers = Parser.parse(QualifierList)
local qualifiers = Parser.altParse(QualifierList)
mw.logObject(qualifiers)
local result = {}
local result = {}
for q, r in pairs(qualifiers) do
for _, tupel in ipairs(qualifiers) do
local qual = q:match('[qQ]%d+')
local q="Fehler"
local r="Bitte nur mit Listenelementen im Format Q1234{Bemerkung} einsetzen! [[Kategorie:Wikipedia:Qualitätssicherung Vorlageneinbindung fehlerhaft]]"
if type(r) == "table" then
if type(tupel) ~= "table" then return {{q, r}} end
if qual then
if tupel[2] == nil then return {{q, r}} end
mw.log('q: ' .. q .. ' qual: ' .. qual .. ' r:')
if type(tupel[2]) == "table" then
else
mw.log('q: ' .. q .. ' qual: <nil> r:')
mw.logObject(tupel[2], 'r')
return {{q, r}}
end
mw.logObject(r)
else
if qual then
mw.log('q: ' .. q .. ' r: ' .. r .. ' qual: ' .. qual)
else
mw.log('q: ' .. q .. ' r: ' .. r .. ' qual: <nil>')
end
end
end
q=tupel[1]
if qual then
local resultElm = {remark=r[1]}
local resultElm = p.service.unicode(q)
if resultElm then
resultElm.label = mw.wikibase.getSitelink(qual)
if resultElm.label == nil then
resultElm.remark = tupel[2]
resultElm.label = mw.wikibase.getLabel(qual)
end
resultElm.description = mw.wikibase.getDescription(qual)
local uniQraw = mw.wikibase.getBestStatements(qual, "P1299")
if uniQraw[1] then
local unicodeQ = uniQraw[1]["mainsnak"]["datavalue"]["value"]["id"]
resultElm.block = MSValue(unicodeQ, "P5522")
resultElm.name = MSValue(unicodeQ, "P9382")
resultElm.code = MSValue(unicodeQ, "P4213")
else
resultElm.block = ""
resultElm.name = ""
resultElm.code = ""
end
table.insert(result, resultElm)
table.insert(result, resultElm)
end
end
Zeile 446: Zeile 228:
Zeichenkette nach dem Schema 'class="<Liste>" style="<styles>"'
Zeichenkette nach dem Schema 'class="<Liste>" style="<styles>"'
optional, default: 'style="font-size:250%;"'
optional, default: 'style="font-size:250%;"'
charPrefix=<string>
Zeichenkette, die jedem Zeichen vorangestellt werden soll
optional, default: ''
Bsp (für Akzente): charPrefix=&#x25CC;
remarkLabel=<string>
remarkLabel=<string>
Bezeichner als Spaltenkopf für die Anmerkungen
Bezeichner als Spaltenkopf für die Anmerkungen
Zeile 460: Zeile 246:
end
end
result = result .. '><tr>'
result = result .. '><tr>'
local charPref = ''
if frame.args.charPrefix then
charPref = frame.args.charPrefix
end
mw.log(charPref)
local thTag = "<th"
local thTag = "<th"
if frame.args.tableStyles ~= nil then
if frame.args.thStyles ~= nil then
thTag = thTag .. ' ' .. frame.args.tableStyles .. '>'
thTag = thTag .. ' ' .. frame.args.thStyles .. '>'
else
else
thTag = thTag .. '>'
thTag = thTag .. '>'
Zeile 483: Zeile 274:
else
else
if frame.args.charStyles then
if frame.args.charStyles then
result = result .. frame.args.charStyles
result = result .. frame.args.charStyles .. '>'
else
else
result = result .. 'style="font-size:250%;"'
result = result .. 'style="font-size:250%;">'
end
end
result = result .. '>&#x' .. row.code .. ';</td><td>U+'
mw.log(charPref .. '&#x' .. row.code .. ';')
result = result .. charPref .. '&#x' .. row.code .. ';</td><td>U+'
result = result .. row.code .. '</td><td>'
result = result .. row.code .. '</td><td>'
result = result .. row.name .. '</td><td>'
result = result .. row.name .. '</td><td>'

Aktuelle Version vom 19. Juli 2022, 17:45 Uhr

verwendete Moduln:
SimpleStruct
SimpleDataAccess
Zeichenfolge
Vorlagenprogrammierung Diskussionen Lua Unterseiten
Modul Deutsch English

Modul: Dokumentation

Diese Seite enthält Code in der Programmiersprache Lua. Einbindungszahl Cirrus


--[=[ Zeichen 2022-06-12
Data Management Module for Access from Within Templates and Other Modules
providing infos for signs usually using unicode for display
Author: Vollbracht
* data()	Wikidata information for current sign in table form
* byQ()		data for a list of signs (not unicode representations!) given by
			Wikidata qualifiers
]=]
	
--Module globals
local p = {service = {}}

local _, Parser = pcall(require, "Modul:SimpleStruct")
local _, Limited = pcall(require, "Modul:SimpleDataAccess")
local _, SequenceMod = pcall(require, "Modul:Zeichenfolge")
local Sequence = SequenceMod.service

--[[
	data() / service.data()
	returns wikidata information for current page containing unicode information
	if available
]]
p.service.data = function()
	local result = {}
	result.label = mw.wikibase.getLabel()
	result.description = mw.wikibase.getDescription()
	local character = mw.wikibase.getEntity()
	if character == nil then
		return {
			label="Fehler",
			description="Bitte nur auf Seiten zur Zeichenbeschreibung mit Wikidata einsetzen! [[Kategorie:Wikipedia:Qualitätssicherung Vorlageneinbindung fehlerhaft]]",
			code = "",
			block = ""
		}
	end
	local uniQraw = character["claims"]["P1299"]
	if uniQraw == nil then
		result.code = ""
		result.block = ""
	else
		local unicodeQ = uniQraw[1]["mainsnak"]["datavalue"]["value"]["id"]
		result.block = Limited.MainSnackValue(unicodeQ, "P5522")
		result.name = Limited.MainSnackValue(unicodeQ, "P9382")
		result.code = Limited.MainSnackValue(unicodeQ, "P4213")
	end
	return result
end

--[[
	language specific function returning table with German headers
	description in German:
	
	Zeichen|data|<Parameter>
	gibt in eine Tabelle wikidata-Informationen zur aktuellen Seite zurück
	Parameter:
		tableStyles=<string>
			Zeichenkette nach dem Schema 'class="<Liste>" style="<styles>"'
			optional
		thStyles=<string>
			Zeichenkette nach dem Schema 'class="<Liste>" style="<styles>"'
			optional
		charStyles=<string>
			Zeichenkette nach dem Schema 'class="<Liste>" style="<styles>"'
			optional, default: 'style="font-size:250%;"'
		charPrefix=<string>
			Zeichenkette, die jedem Zeichen vorangestellt werden soll
			optional, default: ''
			Bsp (für Akzente): charPrefix=&#x25CC;
		addRows=<Liste>
			eine Liste von zusätzlichen Zeilen nach dem Schema
			'Name{<Wert>}'
			die Elemente können durch Leerzeichen, Zeilenumbrüche, etc.
			separiert sein. Werte dürfen keine geschweiften Klammern
			enthalten.
		rvStyles=<string>
			Zeichenkette nach dem Schema 'class="<Liste>" style="<styles>"'
			für die Werte der addRows
			optional
]]
p.data = function(frame)
	local source = p.service.data()
	local result = '<table '
	local charStyles = 'style="font-size:250%;"'
	if frame.args.charStyles then
		charStyles = frame.args.charStyles
	end
	local charPref = ''
	if frame.args.charPrefix then
		charPref = frame.args.charPrefix
	end
	local list = Sequence.listOfShortListsCore(
						frame.args.addList, frame.args.thStyles, charStyles)
	if frame.args.tableStyles then
		result = result .. frame.args.tableStyles
	else
		result = result .. 'class="float-right infobox toptextcells toccolours"'
		result = result .. ' cellspacing="5"'
		--mw.log('284f: list')
		--mw.logObject(list)
		if list == "" then
			result = result .. ' style="width:240px;"'
		else
			result = result .. ' style="width:300px;"'
		end
	end
	result = result .. '><tr><th colspan="2"'
	if frame.args.thStyles ~= nil then
		result = result .. frame.args.thStyles
	end
	result = result .. '>' .. source.label .. ':<br />' .. source.description
	result = result .. '</th></tr><tr>'
	if source.code == "" then
		result = result .. '<td colspan="2">(kein unicode Zeichen)'
	else
		result = result .. '<td style="vertical-align: middle;">Zeichen:</td>'
		result = result .. '<td><span ' .. charStyles .. '>'
		result = result .. charPref .. '&#x' .. source.code
		result = result .. ';</span></td></tr><tr><td>Codepunkt:</td>'
		result = result .. '<td>U+' .. source.code
		result = result .. '</td></tr><tr><td>Unicode-Name:</td><td>'
		result = result .. source.name
		result = result .. '</td></tr><tr><td>Codeblock:</td><td>'
		result = result .. frame:preprocess('[[' .. source.block .. ']]')
	end
	result = result .. '</td></tr>'
	if frame.args.addRows then
		local rows = Parser.altParse(frame.args.addRows)
		if rows ~= nil then
			for _, v in ipairs(rows) do
				result = result .. '<tr><td style="vertical-align: middle;">'
				result = result .. v[1]
				result = result .. '</td><td ' .. frame.args.rvStyles .. '>'
				result = result .. v[2] .. '</td></tr>'
			end
		end
	end
	if list ~= "" then
		if frame.args.addListTitle then
			result = result .. '<tr><th colspan="2" '
			if frame.args.thStyles ~= nil then
				result = result .. frame.args.thStyles
			end
			result = result .. '>' .. frame.args.addListTitle .. '</th></tr>'
		end
		result = result .. list
	end
	result = result .. '</table>'
	return result
end

p.service.unicode = function(Qualifier)
	local qual = Qualifier:match('[qQ]%d+')
	local result = {}
	if qual then
		result.label = mw.wikibase.getSitelink(qual)
		if result.label == nil then
			result.label = mw.wikibase.getLabel(qual)
		end
		result.description = mw.wikibase.getDescription(qual)
		local uniQraw = mw.wikibase.getBestStatements(qual, "P1299")
		if uniQraw[1] then
			local unicodeQ = uniQraw[1]["mainsnak"]["datavalue"]["value"]["id"]
			result.block = Limited.MainSnackValue(unicodeQ, "P5522")
			result.name = Limited.MainSnackValue(unicodeQ, "P9382")
			result.code = Limited.MainSnackValue(unicodeQ, "P4213")
		else
			result.block = ""
			result.name = ""
			result.code = ""
		end
		return result
	else
		return nil
	end	
end

--[[
	byQ(QualifierList) / service.byQ(QualifierList)
	returns a struct (table) containing signs with some of their wikidata infos,
	especially their unicode representations if available
	QualifierList	list of qualifiers with remarks in the form 'Q1234{remark}'
					all entries may be separated by white spaces (even line
					breaks) and remarks can be structs themselves, however if a
					remark is more than a simple string p.byQ() won't be able to
					format this correctly.
]]
p.service.byQ = function(QualifierList)
	local qualifiers = Parser.altParse(QualifierList)
	local result = {}
	for _, tupel in ipairs(qualifiers) do
		local q="Fehler"
		local r="Bitte nur mit Listenelementen im Format Q1234{Bemerkung} einsetzen! [[Kategorie:Wikipedia:Qualitätssicherung Vorlageneinbindung fehlerhaft]]"
		if type(tupel) ~= "table" then return {{q, r}} end
		if tupel[2] == nil then return {{q, r}} end
		if type(tupel[2]) == "table" then
			mw.logObject(tupel[2], 'r')
			return {{q, r}}
		end
		q=tupel[1]
		local resultElm = p.service.unicode(q)
		if resultElm then
			resultElm.remark = tupel[2]
			table.insert(result, resultElm)
		end
	end
	return result
end

--[[
	language specific function returning table with German headers
	description in German:
	
	Zeichen|byQ|<Parameter>
	gibt eine Tabelle aller in den Parametern angegebenen Zeichen zurück
	Parameter:
		QualifierList=<Liste>
			eine Liste von Elementen nach dem Schema 'Q1234{<Anmerkung>}'
			die Elemente können durch Leerzeichen, Zeilenumbrüche, etc.
			separiert sein. Anmerkungen dürfen keine geschweiften Klammern
			enthalten.
		tableStyles=<string>
			Zeichenkette nach dem Schema 'class="<Liste>" style="<styles>"'
			optional
		thStyles=<string>
			Zeichenkette nach dem Schema 'class="<Liste>" style="<styles>"'
			optional
		charStyles=<string>
			Zeichenkette nach dem Schema 'class="<Liste>" style="<styles>"'
			optional, default: 'style="font-size:250%;"'
		charPrefix=<string>
			Zeichenkette, die jedem Zeichen vorangestellt werden soll
			optional, default: ''
			Bsp (für Akzente): charPrefix=&#x25CC;
		remarkLabel=<string>
			Bezeichner als Spaltenkopf für die Anmerkungen
]]
p.byQ = function(frame)
	local list = frame.args.QualifierList
	if list == nil then return "" end
	if list == "" then return "" end
	local source = p.service.byQ(list)
	if source == {} then return "" end
	local result = "<table"
	if frame.args.tableStyles ~= nil then
		result = result .. ' ' .. frame.args.tableStyles
	end
	result = result .. '><tr>'
	local charPref = ''
	if frame.args.charPrefix then
		charPref = frame.args.charPrefix
	end
	mw.log(charPref)
	local thTag = "<th"
	if frame.args.thStyles ~= nil then
		thTag = thTag .. ' ' .. frame.args.thStyles .. '>'
	else
		thTag = thTag .. '>'
	end
	result = result .. thTag .. 'Name</th>' .. thTag .. 'Beschreibung</th>'
	result = result .. thTag .. 'Zeichen</th>' .. thTag .. 'Codepunkt</th>'
	result = result .. thTag .. 'Unicode-Name</th>'
	result = result .. thTag .. 'Codeblock</th>' .. thTag
	if frame.args.remarkLabel then
		result = result .. frame.args.remarkLabel .. '</th></tr>'
	else
		result = result .. 'Anmerkung</th></tr>'
	end
	for ign1, row in ipairs(source) do
		result = result .. '<tr><td>'
		result = result .. frame:preprocess('[[' .. row.label .. ']]')
		result = result .. '</td><td>' .. row.description .. '</td><td '
		if row.code == "" then
			result = result .. 'colspan="4">(kein unicode Zeichen)</td><td>'
		else
			if frame.args.charStyles then
				result = result .. frame.args.charStyles .. '>'
			else
				result = result .. 'style="font-size:250%;">'
			end
	mw.log(charPref .. '&#x' .. row.code .. ';')
			result = result .. charPref .. '&#x' .. row.code .. ';</td><td>U+'
			result = result .. row.code .. '</td><td>'
			result = result .. row.name .. '</td><td>'
			result = result .. frame:preprocess('[[' .. row.block .. ']]')
			result = result .. '</td><td>'
		end
		result = result .. frame:preprocess(row.remark) .. '</td></tr>'
	end
	result = result .. '</table>'
	return result
end

return p