markdown: (value) ->
types = (
for type in value.types
if type.match /^\.\.\.|\.\.\.$/
"any number of #{humanize.pluralize type.replace(/^\.\.\.|\.\.\.$/, "")}"
else if type.match /\[\]$/
"an Array of #{humanize.pluralize type.replace(/\[\]$/, "")}"
else
"#{humanize.article type} #{type}"
)
fragments = []
fragments.push 'is optional' if value.isOptional
verb = 'must'
if types.length > 1
verb = 'can'
else if types[0] == 'a Mixed'
verb = 'can'
types[0] = 'of any type'
else if types[0] == 'an Array of Mixeds'
verb = 'can'
types[0] = 'an Array of any type'
else if types[0] == 'any number of Mixeds'
verb = 'can'
types[0] = 'any number of arguments of any type'
fragments.push "#{verb} be #{humanize.joinSentence types, 'or'}"
fragments.push "has a default value of #{value.defaultValue}" if value.defaultValue?
"#{if value.isSubParam then " *" else "*"} **#{value.varName} #{humanize.joinSentence fragments}.**#{if value.description.length then '<br/>(' else ''}#{value.description}#{if value.description.length then ')' else ''}"
params: 'param'
parameters: 'param'
'return':
section: 'returns'
parseValue: (value) ->
parts = collapse_space(value).match /^\{([^\}]+)\}\s*(.*)$/
types: parts[1].split /\|{1,2}/g
description: parts[2]
markdown: (value) ->
types = ("#{humanize.article type} #{type}" for type in value.types)
"**returns #{types.join ' or '}**#{if value.description.length then '<br/>(' else ''}#{value.description}#{if value.description.length then ')' else ''}"
returns: 'return'
throw:
section: 'returns'
parseValue: (value) ->
parts = collapse_space(value).match /^\{([^\}]+)\}\s*(.*)$/
types: parts[1].split /\|{1,2}/g
description: parts[2]
markdown: (value) ->
types = ("#{humanize.article type} #{type}" for type in value.types)
"**can throw #{types.join ' or '}**#{if value.description.length then '<br/>(' else ''}#{value.description}#{if value.description.length then ')' else ''}"
throws: 'throw'
defaultNoValue:
section: 'flags'
defaultHasValue:
section: 'metadata'
Known Doc Tags