diff --git a/lib/jsduck/tag/deprecated.rb b/lib/jsduck/tag/deprecated.rb index d2f3971a2bd7f5f37c66381ba78ed359b3a67400..83b0c78219d0c561bf9b09ab92301ec198883d5f 100644 --- a/lib/jsduck/tag/deprecated.rb +++ b/lib/jsduck/tag/deprecated.rb @@ -4,10 +4,14 @@ module JsDuck::Tag class Deprecated < DeprecatedTag def initialize @tagname = :deprecated + @msg = "This {TAGNAME} has been deprected" @css = <<-EOCSS .signature .deprecated { background-color: #aa0000; } + .deprecated-box { + border: 2px solid #aa0000; + } .deprecated-box strong { color: white; background-color: #aa0000; diff --git a/lib/jsduck/tag/deprecated_tag.rb b/lib/jsduck/tag/deprecated_tag.rb index b76cfc486fe161f8f472ecc581185cb2903ca438..322b683c3ae93c40f6cd796ca882dfd29a4e4027 100644 --- a/lib/jsduck/tag/deprecated_tag.rb +++ b/lib/jsduck/tag/deprecated_tag.rb @@ -2,14 +2,15 @@ require "jsduck/tag/tag" module JsDuck::Tag # Base class for both @deprecated and @removed. Child classes only - # need to define the @tagname attribute and call #super - all the - # correct behavior will the fall out automatically. + # need to define the @tagname and @msg attributes and call #super - + # all the correct behavior will the fall out automatically. class DeprecatedTag < Tag def initialize if @tagname @pattern = @tagname.to_s @signature = {:long => @tagname.to_s, :short => @tagname.to_s[0..2].upcase} @html_position = POS_DEPRECATED + @since = "since" unless @since @css += <<-EOCSS .deprecated-tag-box { text-align: center; @@ -45,10 +46,11 @@ module JsDuck::Tag def to_html(context) depr = context[@tagname] - v = depr[:version] ? "since " + depr[:version] : "" + msg = @msg.sub(/\{TAGNAME\}/, context[:tagname].to_s) + v = depr[:version] ? "#{@since} " + depr[:version] : "" <<-EOHTML
This #{context[:tagname]} has been #{@tagname} #{v}
+#{msg} #{v}
#{depr[:text]}