# See also: # - https://github.com/senchalabs/jsduck/wiki/Tags # - https://github.com/senchalabs/jsduck/wiki/Custom-tags require 'jsduck/meta_tag' class SourceTag < JsDuck::MetaTag def initialize # This defines the name of the @tag @name = 'source' end # Generate HTML output for this tag. # One can make use of the #format method to easily support # Markdown and {@link} tags inside the contents of the tag. # # @param tags All matches of this tag on one class. def to_html(tags) '

Source

' + tags.map {|tag| format(tag) }.join("\n") end end class ContextTag < JsDuck::MetaTag def initialize @name = 'context' end # @param tags All matches of this tag on one class. def to_html(tags) return '

Context

' + render_long_context(tags.last) end def render_long_context(tag) if tag =~ /\A([^\s]+)/m name = $1 return format("`this` : {@link #{name}}") end end end class SeeTag < JsDuck::MetaTag def initialize @name = 'see' @multiline = true end # @param tags All matches of this tag on one class. def to_html(tags) doc = [] doc << '

Related

' doc << [ '', ] doc end def render_long_see(tag) if tag =~ /\A([^\s]+)( .*)?\Z/m name = $1 doc = $2 ? ': ' + $2 : '' return [ '
  • ', format("{@link #{name}} #{doc}"), '
  • ' ] end end end