「
モジュール:Lua banner
」を編集中
ナビゲーションに移動
検索に移動
警告:
ログインしていません。編集を行うと、あなたの IP アドレスが公開されます。
ログイン
または
アカウントを作成
すれば、あなたの編集はその利用者名とともに表示されるほか、その他の利点もあります。
スパム攻撃防止用のチェックです。 けっして、ここには、値の入力は
しない
でください!
-- {{lua}}というテンプレートで使用されるモジュールです。 local yesno = require('Module:Yesno') local mList = require('Module:List') local mTableTools = require('Module:TableTools') local mMessageBox = require('Module:Message box') local p = {} function p.main(frame) local origArgs = frame:getParent().args local args = {} for k, v in pairs(origArgs) do v = v:match('^%s*(.-)%s*$') if v ~= '' then args[k] = v end end return p._main(args) end function p._main(args) local modules = mTableTools.compressSparseArray(args) local box = p.renderBox(modules) local trackingCategories = p.renderTrackingCategories(args, modules) return box .. trackingCategories end function p.renderBox(modules) local boxArgs = {} if #modules < 1 then boxArgs.text = '<strong class="error">エラー: モジュール名が指定されていません</strong>' else local moduleLinks = {} for i, module in ipairs(modules) do moduleLinks[i] = string.format('[[:%s]]', module) end local moduleList = mList.makeList('bulleted', moduleLinks) boxArgs.text = '[[Wikipedia:Lua|Lua]]モジュールを使用しています:' .. moduleList end boxArgs.type = 'notice' boxArgs.small = true boxArgs.image = '[[File:Lua-logo-nolabel.svg|30px|alt=Lua logo|link=Wikipedia:Lua]]' return mMessageBox.main('mbox', boxArgs) end function p.renderTrackingCategories(args, modules, titleObj) if yesno(args.nocat) then return '' end local cats = {} -- Error category if #modules < 1 then cats[#cats + 1] = '' end -- Lua templates category titleObj = titleObj or mw.title.getCurrentTitle() local subpageBlacklist = { doc = true, sandbox = true, sandbox2 = true, testcases = true } if titleObj.namespace == 10 and not subpageBlacklist[titleObj.subpageText] then local category = args.category if not category then --[[ local categories = { ['Module:String'] = '', ['Module:Math'] = '', ['Module:BaseConvert'] = '', ['Module:Citation'] = '' } categories['Module:Citation/CS1'] = categories['Module:Citation'] category = modules[1] and categories[modules[1]] --]] category = category or 'Luaを利用するテンプレート' end cats[#cats + 1] = category end for i, cat in ipairs(cats) do cats[i] = string.format('[[Category:%s]]', cat) end return table.concat(cats) end return p
編集内容の要約:
14Channel BBS Wikiへの投稿はすべて、他の投稿者によって編集、変更、除去される場合があります。 自分が書いたものが他の人に容赦なく編集されるのを望まない場合は、ここに投稿しないでください。
また、投稿するのは、自分で書いたものか、パブリック ドメインまたはそれに類するフリーな資料からの複製であることを約束してください(詳細は
14Channel BBS Wiki:著作権
を参照)。
著作権保護されている作品は、許諾なしに投稿しないでください!
編集を中止
編集の仕方
(新しいウィンドウで開きます)
このページで使用されているテンプレート:
モジュール:Lua banner/doc
(
編集
)
案内メニュー
個人用ツール
ログインしていません
トーク
投稿記録
アカウント作成
ログイン
名前空間
モジュール
議論
English
表示
閲覧
ソースを編集
履歴表示
その他
案内
メインページ
最近の更新
おまかせ表示
MediaWikiについてのヘルプ
NML
NMLとは
ルビ振り
文字列シャッフル
AAをきれいに表示
スレッドの記事
安倍ガチャスレ
レンタルサーバー
シン・クラウド for Free
他サイト
防儲(Libre)
三男掲示板
ツール
リンク元
関連ページの更新状況
特別ページ
ページ情報