Χρήστης:Sarri.greek/luanotes: Διαφορά μεταξύ των αναθεωρήσεων

Περιεχόμενο που διαγράφηκε Περιεχόμενο που προστέθηκε
split param pages
Χωρίς σύνοψη επεξεργασίας
Γραμμή 83:
]=]--
 
 
---------------------------------------------- SPLIT param pages
---------------------------------------------- REQUIRE SUBPAGES with FUNCTIONS
module_path = 'Module:xx'
--m_all = require(module_path .. "/all") -- ?????????? how can I join xx/1, xx/2, xx/3 etc
 
m_1 = require(module_path .. "/1") -- or write require("Module:xx/1")
-- cannot call them all directly from here. They call each other, nested:
-- this module calls: m_1 = require(module_path .. "/1")
-- m_1 calls: m_2 = require(module_path .. "/2")
-- m_2 .... calls m_3 etc
 
---------------------------------------------- SPLIT data pages (data only, no ifs)
--------------------------------------------------------------------------
-- Module + data (ONLY data) pages
--------------------------------------------------------------------------
 
--[=[
ΟΔΗΓΙΕΣ - INSTRUCTIONS
Load this module using mw.loadData(), not using require() which is intended for modules with functions.
USE e.g.: local data = mw.loadData("Module:XXX/data")
IF: local module_path = 'Module:YYY'
USE: local data = mw.loadData(module_path .."/data")
HOW to call it:
data.xxxx, or: data[xxx]['the category keyword']
]=]--
 
-- ============== STYLE 1 as in [[Module:labels/data]] Make sure there is a COMMA after each entry
return {
-- α
['αγγλισμός'] = { link='αγγλισμός', linkshow='αγγλισμός', word_cat='Αγγλισμοί', key='αγγλισμοι', style=true },
}
 
-- STYLE1 b with subdivisions as in [[Module:auto cat/data]]
--[=[
How to call them:
-- i write: if data.level_1[cat_title]['thiskey'] then <do this> end
-- i write fields like: .. data.label[cat_title]['key'] .. or data.label[cat_title].anykey
]=]--
 
local label = {
level_1 = {
['Modules'] = { key='modules' },
},
level_1bylang = {
['Θεματικές κατηγορίες'] = { key='θεματικεσ', }, -- show='Θεματικές'
},
} -- close local label
 
-- =============== STYLE2 with key at beginning as in [[Module:topos/kind]]
-- no comma need here
-- repeat the first keyword, so that we can RELATE other keywords with it See [[Module:lang]]
 
kind = {}
 
kind['αεροδρόμιο'] = { kind='αεροδρόμιο', word='αεροδρόμιο', word_pl='αεροδρόμια', word_cat='Αεροδρόμια',
key='αεροδρομια', parent='', extra1='Αεροπορικοί όροι' }
 
return kind
 
 
 
---------------------------------------------- SPLIT param pages (with ifs)
-- ========== Module:xxx/param === parameters of Module:xxx ========== --
-- INSTRUCTIONS:
Γραμμή 205 ⟶ 266 :
return main(args) -- return args as in Module:xxx/main
end
--------------------------------------------------------------------------
-- Module + data (ONLY data) pages
--------------------------------------------------------------------------
 
--[=[
ΟΔΗΓΙΕΣ - INSTRUCTIONS
Load this module using mw.loadData(), not using require() which is intended for modules with functions.
USE e.g.: local data = mw.loadData("Module:XXX/data")
IF: local module_path = 'Module:YYY'
USE: local data = mw.loadData(module_path .."/data")
HOW to call it:
data.xxxx, or: data[xxx]['the category keyword']
]=]--
 
-- ============== STYLE 1 as in [[Module:labels/data]] Make sure there is a COMMA after each entry
return {
-- α
['αγγλισμός'] = { link='αγγλισμός', linkshow='αγγλισμός', word_cat='Αγγλισμοί', key='αγγλισμοι', style=true },
}
 
-- STYLE1 b with subdivisions as in [[Module:auto cat/data]]
--[=[
How to call them:
-- i write: if data.level_1[cat_title]['thiskey'] then <do this> end
-- i write fields like: .. data.label[cat_title]['key'] .. or data.label[cat_title].anykey
]=]--
 
local label = {
level_1 = {
['Modules'] = { key='modules' },
},
level_1bylang = {
['Θεματικές κατηγορίες'] = { key='θεματικεσ', }, -- show='Θεματικές'
},
} -- close local label
 
-- =============== STYLE2 with key at beginning as in [[Module:topos/kind]]
-- no comma need here
-- repeat the first keyword, so that we can RELATE other keywords with it See [[Module:lang]]
 
kind = {}
 
kind['αεροδρόμιο'] = { kind='αεροδρόμιο', word='αεροδρόμιο', word_pl='αεροδρόμια', word_cat='Αεροδρόμια',
key='αεροδρομια', parent='', extra1='Αεροπορικοί όροι' }
 
return kind
 
 
--------------------------------------------------------------------------