Loading lib/jsduck/merger.rb +6 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ module JsDuck general_merge(h, docs, code) invoke_merge_in_tags(h, docs, code) invoke_merge_in_member_tag(h, docs, code) # Needs to be calculated last, as it relies on the existance of # :name, :static and :tagname fields. Loading @@ -48,6 +49,11 @@ module JsDuck end end # Invokes the #merge method in corresponding member or :class tag. def invoke_merge_in_member_tag(h, docs, code) TagRegistry.get_by_name(h[:tagname]).merge(h, docs, code) end # Applies default merge algorithm to the rest of the data. def general_merge(h, docs, code) # Add all items in docs not already in result. Loading lib/jsduck/tag/cfg.rb +7 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,13 @@ module JsDuck::Tag h end # Do the merging of :type field def merge(h, docs, code) if h[:type] == nil h[:type] = code[:tagname] == :method ? "Function" : "Object" end end def to_html(cfg, cls) JsDuck::Render::PropertySignature.render(cfg) end Loading lib/jsduck/tag/css_var.rb +5 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,11 @@ module JsDuck::Tag h end # Set default value for :type field def merge(h, docs, code) h[:type] = "Object" unless h[:type] end def to_html(var, cls) JsDuck::Render::PropertySignature.render(var) end Loading lib/jsduck/tag/property.rb +7 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,13 @@ module JsDuck::Tag h end # Do the merging of :type field def merge(h, docs, code) if h[:type] == nil h[:type] = code[:tagname] == :method ? "Function" : "Object" end end def to_html(property, cls) JsDuck::Render::PropertySignature.render(property) end Loading lib/jsduck/tag/type.rb +0 −8 Original line number Diff line number Diff line Loading @@ -5,7 +5,6 @@ module JsDuck::Tag def initialize @pattern = "type" @tagname = :type @merge_context = :member # We don't really care about the position as we don't output any # HTML. We just need to set this up to do the formatting. Loading @@ -31,13 +30,6 @@ module JsDuck::Tag h[:type] = tags[0][:type] unless h[:type] end # Do the merging of :type field def merge(h, docs, code) if h[:type] == nil && ([:property, :cfg, :css_var].include?(h[:tagname])) h[:type] = code[:tagname] == :method ? "Function" : "Object" end end def format(m, formatter) m[:html_type] = formatter.format_type(m[:type]) end Loading Loading
lib/jsduck/merger.rb +6 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ module JsDuck general_merge(h, docs, code) invoke_merge_in_tags(h, docs, code) invoke_merge_in_member_tag(h, docs, code) # Needs to be calculated last, as it relies on the existance of # :name, :static and :tagname fields. Loading @@ -48,6 +49,11 @@ module JsDuck end end # Invokes the #merge method in corresponding member or :class tag. def invoke_merge_in_member_tag(h, docs, code) TagRegistry.get_by_name(h[:tagname]).merge(h, docs, code) end # Applies default merge algorithm to the rest of the data. def general_merge(h, docs, code) # Add all items in docs not already in result. Loading
lib/jsduck/tag/cfg.rb +7 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,13 @@ module JsDuck::Tag h end # Do the merging of :type field def merge(h, docs, code) if h[:type] == nil h[:type] = code[:tagname] == :method ? "Function" : "Object" end end def to_html(cfg, cls) JsDuck::Render::PropertySignature.render(cfg) end Loading
lib/jsduck/tag/css_var.rb +5 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,11 @@ module JsDuck::Tag h end # Set default value for :type field def merge(h, docs, code) h[:type] = "Object" unless h[:type] end def to_html(var, cls) JsDuck::Render::PropertySignature.render(var) end Loading
lib/jsduck/tag/property.rb +7 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,13 @@ module JsDuck::Tag h end # Do the merging of :type field def merge(h, docs, code) if h[:type] == nil h[:type] = code[:tagname] == :method ? "Function" : "Object" end end def to_html(property, cls) JsDuck::Render::PropertySignature.render(property) end Loading
lib/jsduck/tag/type.rb +0 −8 Original line number Diff line number Diff line Loading @@ -5,7 +5,6 @@ module JsDuck::Tag def initialize @pattern = "type" @tagname = :type @merge_context = :member # We don't really care about the position as we don't output any # HTML. We just need to set this up to do the formatting. Loading @@ -31,13 +30,6 @@ module JsDuck::Tag h[:type] = tags[0][:type] unless h[:type] end # Do the merging of :type field def merge(h, docs, code) if h[:type] == nil && ([:property, :cfg, :css_var].include?(h[:tagname])) h[:type] = code[:tagname] == :method ? "Function" : "Object" end end def format(m, formatter) m[:html_type] = formatter.format_type(m[:type]) end Loading