Modul:Match: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Krd (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung Markierung: Manuelle Zurücksetzung |
Krd (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
||
(11 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
Zeile 7: | Zeile 7: | ||
local text = title:getContent() | local text = title:getContent() | ||
local r = string.match(text, '\nDatum: ([%a%d%p]+)') | local r = string.match(text, '\nDatum: ([%a%d%p]+)') | ||
r = string.gsub(r, ' ', '') | |||
r = string.gsub(r, '-', '–') | |||
return r | return r | ||
end | end | ||
function p. | function p.str(frame) | ||
local page = frame.args[1] | local page = frame.args[1] | ||
local s = frame.args[2] | |||
page = 'Match:' .. page | page = 'Match:' .. page | ||
local title = mw.title .new(page) | local title = mw.title .new(page) | ||
local text = title:getContent() | local text = title:getContent() | ||
local r = string.match(text, '\ | local r = string.match(text, '\n'..s..': (%C+)\n') | ||
return r | return r | ||
end | end | ||
function p. | function p.is(frame) | ||
local page = frame.args[1] | local page = frame.args[1] | ||
local buhl = frame.args[2] | |||
page = 'Match:' .. page | page = 'Match:' .. page | ||
local title = mw.title .new(page) | local title = mw.title .new(page) | ||
local text = title:getContent() | local text = title:getContent() | ||
local r = string.match(text, '\ | local r = string.match(text, '\n'..buhl..': ([Jj][Aa])') | ||
return r | return r | ||
end | end | ||
return p | return p |
Aktuelle Version vom 20. September 2024, 07:58 Uhr
Die Dokumentation für dieses Modul kann unter Modul:Match/Doku erstellt werden
local p = {}
function p.datum(frame)
local page = frame.args[1]
page = 'Match:' .. page
local title = mw.title .new(page)
local text = title:getContent()
local r = string.match(text, '\nDatum: ([%a%d%p]+)')
r = string.gsub(r, ' ', '')
r = string.gsub(r, '-', '–')
return r
end
function p.str(frame)
local page = frame.args[1]
local s = frame.args[2]
page = 'Match:' .. page
local title = mw.title .new(page)
local text = title:getContent()
local r = string.match(text, '\n'..s..': (%C+)\n')
return r
end
function p.is(frame)
local page = frame.args[1]
local buhl = frame.args[2]
page = 'Match:' .. page
local title = mw.title .new(page)
local text = title:getContent()
local r = string.match(text, '\n'..buhl..': ([Jj][Aa])')
return r
end
return p