6,841
edits
No edit summary |
No edit summary |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 517: | Line 517: | ||
else | else | ||
for i,arg in ipairs(entries) do | for i,arg in ipairs(entries) do | ||
local | local tokens = p.split(arg, ' ') | ||
if isEvent then | if isEvent then | ||
rows[i] = { (i + 1)..") ", p.formatType(tokens[1], frame), p.formatName(tokens[2], frame), p.formatDescription( | rows[i] = { (i + 1)..") ", p.formatType(tokens[1], frame), p.formatName(tokens[2], frame), p.formatDescription(table.concat(tokens, ' ', 3, #tokens)) } | ||
else | else | ||
local parts = p.getArgParts(arg) | |||
if parts.optional then | if parts.optional then | ||
if parts.defaultValueIsSpecified then | if parts.defaultValueIsSpecified then | ||
rows[i] = { i..") ", p.formatType(parts.type, frame), p.formatName(parts.name, frame), "Optional, defaults to "..p.formatDefaultValue(parts.defaultValue)..". "..p.formatDescription(parts.description) } | rows[i] = { i..") ", p.formatType(parts.type, frame), p.formatName(parts.name, frame), "Optional, defaults to "..p.formatDefaultValue(parts.defaultValue, frame)..". "..p.formatDescription(parts.description) } | ||
else | else | ||
rows[i] = { i..") ", p.formatType(parts.type, frame), p.formatName(parts.name, frame), "Optional, the default value has not been documented here yet. "..p.formatDescription(parts.description) } | rows[i] = { i..") ", p.formatType(parts.type, frame), p.formatName(parts.name, frame), "Optional, the default value has not been documented here yet. "..p.formatDescription(parts.description) } | ||
| Line 713: | Line 715: | ||
local rows = {} | local rows = {} | ||
if p.isCancellable(frame) then | if p.isCancellable(frame) then | ||
rows[1] = { 'cancellable', 'This '..args.type..' can be cancelled, by using [[event.preventDefault|event.preventDefault]].' } | rows[1] = { 'cancellable', 'This '..args.type..' can be cancelled, by using [[event.preventDefault|event.preventDefault]]().' } | ||
else | else | ||
rows[1] = { p.formatType('const', frame), 'This '..args.type..' cannot be cancelled.' } | rows[1] = { p.formatType('const', frame), 'This '..args.type..' cannot be cancelled.' } | ||
| Line 804: | Line 806: | ||
local entries = p.getIndexedArgs(frame, data2[1]) | local entries = p.getIndexedArgs(frame, data2[1]) | ||
for i2, entry in ipairs(entries) do | for i2, entry in ipairs(entries) do | ||
local entry2 = "'''Example "..exampleIndex.." - "..data2[2]..":'''<br>"..p.loadTemplate(frame, 'CodeSyntax', {entry | local entry2 = "'''Example "..exampleIndex.." - "..data2[2]..":'''<br>"..p.loadTemplate(frame, 'CodeSyntax', {entry,id='example_'..exampleIndex}) | ||
table.insert(examples, entry2) | table.insert(examples, entry2) | ||
exampleIndex = exampleIndex + 1 | exampleIndex = exampleIndex + 1 | ||
edits