Modul:Vorlage:LuaModuleDoc: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Modul:Vorlage:LuaModuleDoc (bearbeiten)
Version vom 24. November 2016, 12:08 Uhr
, 24. November 20162016-11-24
wp>PerfektesChaos (2016-11-24) |
wp>PerfektesChaos (2016-11-24) |
||
Zeile 28: | Zeile 28: | ||
local repo = entity:formatPropertyValues( "P1324" ) | local repo = entity:formatPropertyValues( "P1324" ) | ||
local s, t | local s, t | ||
if repo and repo.value and repo.value:find( "//" ) then | if repo and repo.value and repo.value:find( "//" ) then | ||
repo = mw.uri.new( repo.value ) | repo = mw.uri.new( repo.value ) | ||
if repo and repo.path:match( "^/wiki/" ) then | if repo and repo.path:match( "^/wiki/" ) then | ||
Zeile 47: | Zeile 47: | ||
s = LuaWiki.getArg( "templateGlobal", "" ) | s = LuaWiki.getArg( "templateGlobal", "" ) | ||
if #s > 0 then | if #s > 0 then | ||
local params | local params = { } | ||
local vsn = entity:formatPropertyValues( "P348" ) | |||
if mode < 2 then | if mode < 2 then | ||
params | params[ 1 ] = string.format( "[%s %s]", | ||
tostring( repo ), | |||
repo.host ) | |||
end | end | ||
if vsn and vsn.value and vsn.value ~= "" then | |||
r = | params.version = vsn.value | ||
end | |||
r = Frame:expandTemplate{ title=s, | |||
args=params } | |||
end | end | ||
end | end | ||
Zeile 83: | Zeile 86: | ||
end | end | ||
if t then | if t then | ||
r = string.format( "[[%s|%s]]", | r = r or "" | ||
t.prefixedText, script ) | r = string.format( "%s[[%s|%s]]", | ||
r, t.prefixedText, script ) | |||
end | end | ||
end | end |