2 # - https://github.com/senchalabs/jsduck/wiki/Tags
3 # - https://github.com/senchalabs/jsduck/wiki/Custom-tags
4 require 'jsduck/meta_tag'
6 class SourceTag
< JsDuck
::MetaTag
8 # This defines the name of the @tag
12 # Generate HTML output for this tag.
13 # One can make use of the #format method to easily support
14 # Markdown and {@link} tags inside the contents of the tag.
16 # @param tags All matches of this tag on one class.
18 '<h3 class="pa">Source</h3>' + tags
.map
{|tag
| format(tag
) }.join("\n")
22 class ContextTag
< JsDuck
::MetaTag
27 # @param tags All matches of this tag on one class.
29 return '<h3 class="pa">Context</h3>' + render_long_context(tags
.last
)
32 def render_long_context(tag
)
33 if tag
=~
/\A([^\s]+)/m
35 return format("`this` : {@link #{name}}")
40 class SeeTag
< JsDuck
::MetaTag
46 # @param tags All matches of this tag on one class.
49 doc
<< '<h3 class="pa">Related</h3>'
52 tags
.map
{|tag
| render_long_see(tag
) },
58 def render_long_see(tag
)
59 if tag
=~
/\A([^\s]+)( .*)?\Z/m
61 doc
= $2 ? ': ' + $2 : ''
64 format("{@link #{name}} #{doc}"),