モジュール:Block value
このモジュールは、{{hardness values}}
および {{blast resistance values}}
を実装しています。
依存関係[ソースを編集]
[閲覧 | 編集 | 履歴 | キャッシュ破棄]上記の解説は、モジュール:Block value/docから参照されています。
local p = {}
function p.value( f )
local args = f
if f == mw.getCurrentFrame() then
args = require( 'モジュール:ProcessArgs' ).merge( true )
end
local Reverselink = require( 'モジュール:Reverselink' )
local block = Reverselink.xlink( mw.text.trim( args[1] or '' ):lower() )
local argType = args.type
local argName = args.name
local values = mw.loadData( 'モジュール:' .. argType .. ' values' )
local value = values[block]
local category = ''
if not value then
value = values[block:gsub( 's$', '' )]
if not value then
value = '[[テンプレート:' .. argType .. ' values#欠損値|?]]'
local title = mw.title.getCurrentTitle()
if not args.nocat and title.namespace == 0 and not title.isSubpage then
category = '[[カテゴリ:' .. argName .. 'が不足しているページ]]'
end
end
end
return value .. category
end
return p