Modul:Vorlage:LuaModuleDoc: Unterschied zwischen den Versionen
Modul:Vorlage:LuaModuleDoc (bearbeiten)
Version vom 24. September 2018, 16:12 Uhr
, 24. September 20182018-09-24
(2018-08-01) |
(2018-09-24) |
||
Zeile 1: | Zeile 1: | ||
local LuaModuleDoc = { suite = "LuaModuleDoc", | local LuaModuleDoc = { suite = "LuaModuleDoc", | ||
serial = "2018- | serial = "2018-09-24", | ||
item = 12981914, | item = 12981914, | ||
frame = false, | frame = false, | ||
Zeile 144: | Zeile 144: | ||
local mode = 0 | local mode = 0 | ||
local repo = entity:formatPropertyValues( "P1324" ) | local repo = entity:formatPropertyValues( "P1324" ) | ||
local | local s | ||
if type( repo ) == "table" and | if type( repo ) == "table" and | ||
type( repo.value) == "string" and | type( repo.value) == "string" and | ||
repo.value:find( "//" ) then | repo.value:find( "//" ) then | ||
repo = mw.uri.new( | local t = mw.text.split( repo.value, ",%s+" ) | ||
if #t > 1 then | |||
for i = 1, #t do | |||
if t[ i ]:find( mw.site.server, 1, true ) then | |||
s = t[ i ] | |||
break -- for i | |||
end | |||
end -- for i | |||
if not s then | |||
s = t[ 1 ] | |||
end | |||
else | |||
s = repo.value | |||
end | |||
repo = mw.uri.new( s ) | |||
if type( repo.path ) == "string" and | if type( repo.path ) == "string" and | ||
repo.path:match( "^/wiki/" ) then | repo.path:match( "^/wiki/" ) then | ||
Zeile 169: | Zeile 183: | ||
LuaModuleDoc.title.prefixedText ) | LuaModuleDoc.title.prefixedText ) | ||
local vsn = entity:formatPropertyValues( "P348" ) | local vsn = entity:formatPropertyValues( "P348" ) | ||
params = { } | local params = { } | ||
if mode < 2 then | if mode < 2 then | ||
params[ 1 ] = string.format( "[%s %s]", | params[ 1 ] = string.format( "[%s %s]", | ||
Zeile 667: | Zeile 681: | ||
local vsn = ent:formatPropertyValues( "P348" ) | local vsn = ent:formatPropertyValues( "P348" ) | ||
if type( vsn ) == "table" and | if type( vsn ) == "table" and | ||
type( vsn.value) == "string" and | type( vsn.value ) == "string" and | ||
vsn.value ~= "" then | vsn.value ~= "" then | ||
r = vsn.value | r = vsn.value |