Module:Sandbox/Nyoron/Hide TemplateData

p={}

local function displayError(message) local format = " %s " return mw.ustring.format(format, message) end

local function toWikiStyleLink(url, display) local wikiLinkFormat = '[%s %s]' -- [url display] wiki style url reference local wikiLink = mw.ustring.format(wikiLinkFormat, url, display) local spanFormat = ' %s ' wikiLink = mw.ustring.format(spanFormat, wikiLink) return wikiLink end

local function page(pageTitle, namespaceID, preloadFile, summary) local page = {} page.title = mw.title.new(pageTitle,namespaceID) page.preloadFile = preloadFile page.linkDisplay = mw.site.namespaces[namespaceID].name .. ':' .. pageTitle page.creationSummary = summary page.uri = page.title:fullUrl{action = 'edit', preload = page.preloadFile, summary = page.creationSummary} page.wikiLink = toWikiStyleLink(page.uri, page.linkDisplay) return page end

p.displayMenu = function(frame) local userPage = page("MyPage/common.css",                     mw.site.namespaces.Special.id,                     "User:にょろん/Template/Hide TemplateData/redirect.css",                     ""                     ) return userPage.wikiLink end return p