Editing Module:GetEcopedia
From Eco - English Wiki
Your changes will be displayed to readers once an authorized user accepts them. (help)
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 45: | Line 45: | ||
-- main heading | -- main heading | ||
text = text .. "\'\'\'" .. p.displayName .. "\'\'\' | text = text .. "\'\'\'" .. p.displayName .. "\'\'\'\n" | ||
-- loop through sections (i = array position, j= {sectionType, text} ) | -- loop through sections (i = array position, j= {sectionType, text} ) | ||
for i=1, #p. | for i=1, #p.sections do | ||
-- create a local of the current section | -- create a local of the current section | ||
local sec = p. | local sec = p.sections[i] | ||
if (sec[1] == bodySec) then | if (sec[1] == bodySec) then | ||
text = text .. sec[2] .. " | text = text .. sec[2] .. "\n" | ||
end -- if bodySec | end -- if bodySec | ||
if (sec[1] == headerSec) then | if (sec[1] == headerSec) then | ||
text = text .. " | text = text .. "\'\'" .. sec[2] .. "\'\'\n" | ||
end -- if headerSec | end -- if headerSec | ||
Line 63: | Line 63: | ||
end -- if exists in Ecopedia | end -- if exists in Ecopedia | ||
end -- if page not nil | end -- if page not nil | ||