A Wiki in the Desert
Log in

Difference between revisions of "Module:HerbGallery"

From A Wiki in the Desert
Line 5: Line 5:
 
local origArgs = (type(frame.getParent) == 'function') and frame:getParent().args or frame
 
local origArgs = (type(frame.getParent) == 'function') and frame:getParent().args or frame
 
      
 
      
local imageCount = math.ceil(#origArgs / 2)
+
local imageCount = math.ceil(#origArgs)
    for i = 1, imageCount do
+
return imageCount
      result = result + origArgs[i]
 
    end
 
    return result
 
 
end
 
end
  
 
return p
 
return p

Revision as of 02:33, 15 May 2021

Documentation for this module may be created at Module:HerbGallery/doc

local p = {} --p stands for package

function p.gallery( frame )
    local result = ""
	local origArgs = (type(frame.getParent) == 'function') and frame:getParent().args or frame
    
	local imageCount = math.ceil(#origArgs)
	return imageCount
end

return p