Module:SkillList: Difference between revisions

From Eco - English Wiki
[unchecked revision][unchecked revision]
No edit summary
No edit summary
Line 3: Line 3:
-- Main entry point for the Module
-- Main entry point for the Module
function p.main()
function p.main()
 
 
 
     -- load lists
     -- load lists
     local skillData = require( "Module:SkillData" )
     local skillData = require( "Module:SkillData" )
local skillList = ''
local skillList = ''


local a = {}
--Profession List
if list == 'profession' then
skillList = skillList .. '=== Profession List ===\n'     
for k,v in pairs(skillData.skills) do       
            if skillData.skills[k].Root == 'True' then
              table.insert(a,k)
            end
        end
        table.sort(a)
        for i,n in ipairs(a) do
            skillList = skillList .. '* [[' .. n .. ']]\n'               
        end
end
--Specialty List
if list == 'specialty' then
skillList = skillList .. '=== Specialty List ===\n'
skillList = skillList .. '<div style=\"column-count:2;-moz-column-count:2;-webkit-column-count:2\">\n'
for k,v in pairs(skillData.skills) do       
if skillData.skills[k].Root == 'False' then
              table.insert(a,k)
            end
        end
        table.sort(a)
        for i,n in ipairs(a) do
            skillList = skillList .. '* [[' .. n .. ']]\n'               
        end
skillList = skillList .. '</div>'
end
return skillList
return skillList

Revision as of 06:33, 9 December 2024

This module provides the back end functionality of the Template:SkillList.

If the template is passed, this module creates a list using details from the following Modules:


local p = {}

-- Main entry point for the Module
function p.main()
   	
    -- load lists
    local skillData = require( "Module:SkillData" )
	local skillList = ''

	
	
return skillList
end

return p