Module:Template test case/config: Difference between revisions

From Path of Exile Wiki
Jump to navigation Jump to search
(Import module from Wikipedia)
 
(Change of default parameters)
 
(2 intermediate revisions by the same user not shown)
Line 51: Line 51:
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------


-------------------------------------------------------------------------------
-- PoEWiki-specific changes:
--  * _titlecodeifnotitle=true is a site-specific parameter that's set to true by default.
--    If it's set to true, and if a _title parameter is not present, then the full
--    code of the test case is displayed as the title, as if _titlecode was true.
--  * The default value of _collapsible is true rather than false. This means that
--    all cases will be displayed in collapsible format unless _collapsible is
--    explicitly set to false.
-------------------------------------------------------------------------------
wrappers = {
wrappers = {
['Template:Test case'] = {},
['Template:Test case'] = {
args = {_collapsible = true, _titlecodeifnotitle = true}
},
['Template:Testcase table'] = {
['Template:Testcase table'] = {
args = {_format = 'columns'}
args = {_collapsible = true, _titlecodeifnotitle = true, _format = 'columns'}
},
},
['Template:Testcase rows'] = {
['Template:Testcase rows'] = {
args = {_format = 'rows'}
args = {_collapsible = true, _titlecodeifnotitle = true, _format = 'rows'}
},
},
['Template:Test case nowiki'] = {
['Template:Test case nowiki'] = {
func = 'nowiki'
func = 'nowiki',
args = {_collapsible = true, _titlecodeifnotitle = true}
},
},
['Template:Nowiki template demo'] = {
['Template:Nowiki template demo'] = {
func = 'nowiki',
func = 'nowiki',
args = {showheader = false, showtemplate2 = false}
args = {_collapsible = true, _titlecodeifnotitle = true, showheader = false, showtemplate2 = false}
},
},
['Template:Collapsible test case'] = {
['Template:Collapsible test case'] = {
args = {_collapsible = true}
args = {_titlecodeifnotitle = true, _collapsible = true}
},
},
['Template:Collapsible 2 test case'] = {
['Template:Collapsible 2 test case'] = {
args = {_collapsible = true, _wantdiff = true}
args = {_titlecodeifnotitle = true, _collapsible = true, _wantdiff = true}
},
},
['Template:Inline test case'] = {
['Template:Inline test case'] = {
args = {_format = 'inline', _showcode = true}
args = {_titlecodeifnotitle = true, _collapsible = true, _format = 'inline', _showcode = true}
},
},
},
},

Latest revision as of 17:50, 6 December 2021

Module documentation[view] [edit] [history] [purge]
This module was adapted from Module:Template test case/config on Wikipedia.
Adaptation is noted for reference and attribution only. This module may differ from the original in function or in usage.

This module provides configuration data for Module:Template test case.


-------------------------------------------------------------------------------
--                    Module:Template test case/config
-- This module holds configuration data for [[Module:Template test case]].
-------------------------------------------------------------------------------

return {

-------------------------------------------------------------------------------
-- Options
-------------------------------------------------------------------------------

-- The magic word used in place of the template name when making nowiki
-- invocations.
templateNameMagicWord = '__TEMPLATENAME__',

-- The subpage that sandboxes are typically stored on. Used when loading
-- wrapper template config and when guessing the sandbox template name.
sandboxSubpage = 'sandbox',

-------------------------------------------------------------------------------
-- Messages
-------------------------------------------------------------------------------

msg = {

-- The default header for test cases rendered in columns.
['columns-header'] = 'Side by side comparison',

-- The error message to use if a templaten option is missing.
-- $1 - the number of the missing template option.
['missing-template-option-error'] = "one or more options ending in '$1' " ..
	"were detected, but no 'template$1' option was found",

-- The error message to use if a nowiki invocation is used but the template
-- name magic word is not found.
-- $1 - the value of the template name magic word
['nowiki-magic-word-error'] = "the template invocation must include '$1' in " ..
	"place of the template name",

},

-------------------------------------------------------------------------------
-- Wrapper template config.
-- The wrapper template config is a table with wrapper template names as keys,
-- and subtables containing two fields:
--   func - the function name to be used with that template. This must be a
--       function exported by the main module. This is optional: the default
--       value is "table".
--   args - a table of default arguments to be used with that template. This is
--       is optional.
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
-- PoEWiki-specific changes:
--   * _titlecodeifnotitle=true is a site-specific parameter that's set to true by default.
--     If it's set to true, and if a _title parameter is not present, then the full
--     code of the test case is displayed as the title, as if _titlecode was true.
--   * The default value of _collapsible is true rather than false. This means that
--     all cases will be displayed in collapsible format unless _collapsible is
--     explicitly set to false.
-------------------------------------------------------------------------------
wrappers = {
	['Template:Test case'] = {
		args = {_collapsible = true, _titlecodeifnotitle = true}
	},
	['Template:Testcase table'] = {
		args = {_collapsible = true, _titlecodeifnotitle = true, _format = 'columns'}
	},
	['Template:Testcase rows'] = {
		args = {_collapsible = true, _titlecodeifnotitle = true, _format = 'rows'}
	},
	['Template:Test case nowiki'] = {
		func = 'nowiki',
		args = {_collapsible = true, _titlecodeifnotitle = true}
	},
	['Template:Nowiki template demo'] = {
		func = 'nowiki',
		args = {_collapsible = true, _titlecodeifnotitle = true, showheader = false, showtemplate2 = false}
	},
	['Template:Collapsible test case'] = {
		args = {_titlecodeifnotitle = true, _collapsible = true}
	},
	['Template:Collapsible 2 test case'] = {
		args = {_titlecodeifnotitle = true, _collapsible = true, _wantdiff = true}
	},
	['Template:Inline test case'] = {
		args = {_titlecodeifnotitle = true, _collapsible = true, _format = 'inline', _showcode = true}
	},
},

-------------------------------------------------------------------------------
-- End config
-------------------------------------------------------------------------------

}