Module:test/param
Module:test » Module:test/data :: Module:test/param « Module:test/τεκμηρίωση (documentation)
Αυτό το module καλείται από το Πρότυπο:test - This module is invoked by Template:test.
Check errors at Κατηγορία:Σελίδες με σφάλματα δέσμης ενεργειών
---------------------------------------------- SPLIT param pages (with ifs) By [[w:en:User talk:Trappist the monk]] at wikipedia
-- examples: [[wikt:el:Module:grc-nouns-decl/param]]
-- ========== Module:xxx/param === parameters of Module:xxx ========== --
-- INSTRUCTIONS:
-- Call if from the central declension module by placing EXACTLY where it is needed:
-- require ('Module:xxx/param').param (args)
-- DO NOT change anything else. DO NOT add at top of page a m_main = require this and that.
-- USE: local for the functions
--------------------------------------------------------------------------
-- COPY HERE what is needed for THIS page, from the Module
-- put here local zzzz require("...)
-- put here local xxxx, local yyyy parameters
-- ARRANGE the functions needed from the Module adding: local... and adding local args = {}
--------------------------------------------------------------------------
--[=[ EXAMPLE:
local function create_link (page, text)
local args = {}
if text then
return '[[' .. page .. '|' .. text .. ']]'
else
return '[[' .. page .. ']]'
end
end
]=]--
--[[--------------------------< I S _ S E T >------------
Returns true if argument is set; false otherwise. Argument is 'set' when it exists (not nil) or when it is not an empty string.
]]
--[=[ explanation:
The is_set() function may be added so that tests like this:
if args['ακε'] ~= '' and args['ακε'] ~= nil then args['ακε'] = args['ακε'] else args['ακε'] = '' end
can be reduced to:
if not is_set (args['ακε']) then args['ακε'] = '' end
]=]--
local function is_set (var)
return not (var == nil or var == '');
end
---------------------------------------------------------------------------
-- ========================MAIN FUNCTION================================ --
---------------------------------------------------------------------------
local function param (args) -- this is closed at the end of this page
-- local xxxx = args['ωωω'] or ''
-- if this, do that, end e.g.
--[=[ EXAMPLE: get pagename or λήμμα='...'
local lemma = args['λήμμα'] or ''
PAGENAME = mw.title.getCurrentTitle().text
if lemma == '' or lemma == nil then args['λήμμα'] = PAGENAME:match( "^%s*(.-)%s*$" )
else lemma = args['λήμμα']
end
]=]--
---------------------------------------------------------------------------
-- ============== START HERE ALL PARAMETERS ============== --
---------------------------------------------------------------------------
-- ADD BLOCK HERE
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
end -- close function param
return {param = param}