Module:ScriptItem: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 68: Line 68:


function p.showFunctionPage(frame)
function p.showFunctionPage(frame)
local parts = { "Description", "Parameters", "Returns", "Callbacks" }
local parts = { "Description", "Parameters", "Return", "Callbacks" }
return p.showPage(frame, parts)
return p.showPage(frame, parts)
end
end
Line 78: Line 78:


function p.showMethodPage(frame)
function p.showMethodPage(frame)
local parts = { "Description", "Parameters", "Returns", "Callbacks", "Types" }
local parts = { "Description", "Parameters", "Return", "Callbacks", "Types" }
return p.showPage(frame, parts)
return p.showPage(frame, parts)
end
end
Line 95: Line 95:
end
end
for i,part in ipairs(parts) do
for i,part in ipairs(parts) do
local data = p[part:lower()](frame)
local data = p[part:lower() == 'return' and 'returns' or part:lower()](frame)
if data and #data > 0 then
if data and #data > 0 then
if part == 'Settable' then
if part == 'Settable' then
Line 434: Line 434:
end
end
--[[
-- commented out as failure returns are not currently implemented in GTAC.
if not isVoidReturn then
if not isVoidReturn then
rows = {}
rows = {}
entries = p.getIndexedArgs(frame, 'returnFail')
entries = p.getIndexedArgs(frame, 'returnFail')
text = text.."'''Failure Return :'''\n\n"
text = text.."'''Failure Return:'''\n\n"
if #entries == 0 then
if #entries == 0 then
text = text..p.documentationMissing(frame, "Failure returns")
text = text..p.documentationMissing(frame, "Failure returns")
Line 459: Line 461:
end
end
headers = nil--{ "Type", "Value" }
headers = nil--{ "Type", "Value" }
widths = { 30, 100, 400 }
widths = { 30, 80, 400 }
text = text..p.table(headers, rows, widths, 'wikitable-returns wikitable')
text = text..p.table(headers, rows, widths, 'wikitable-returns wikitable')
end
end
end
end
]]
return text
return text
6,833

edits