Information icon.png 寄付のお願い
現在、本Wikiは深刻な資金難に陥っています。(管理人の発言)
そのため、本Wiki存続のために寄付をお願いします。我々はチームになりつつあります。声なき声に力を。
寄付先
XMR:42V16ycnmYUScKJDLUmnCDZ2BrnPQrojzdBqVgFHdFw9e3pwxyzwhgMYaMBAXRDiYaNGh9Kuw2SxXKo6SMW935RUQEprark
LTC:ltc1qaxex5efs7pk25yke8m7e2qrwsj70lwv2nwjyd4

モジュール:If preview/configuration

提供:唐澤貴洋Wiki
ナビゲーションに移動 検索に移動

このモジュールについての説明文ページを モジュール:If preview/configuration/doc に作成できます

--[[
We perform the actual check for whether this is a preview here since
preprocessing is relatively expensive.
]]
local frame = mw.getCurrentFrame()

local function is_preview()
	local revision_id = frame:preprocess('{{REVISIONID}}')
	-- {{REVISIONID}} is usually the empty string when previewed.
	-- I don't know why we're checking for nil but hey, maybe someday things
	-- would have broken
	return revision_id == nil or revision_id == ''
end

local function templatestyles()
	return frame:extensionTag{
		name = 'templatestyles', args = { src = 'Module:If preview/styles.css' }
	}
end

return {
	preview = is_preview(),
	templatestyles = templatestyles(),
	warning_infrastructure = '%s<div class="preview-warning"><strong>警告:</strong> %s(この警告はプレビューでのみ表示されます)</div>',
	missing_warning = 'このテンプレートには警告文が指定されていません。警告文を追加してください。'
}