Sha256: dc1d1579a72e3d1582fcdb794113dd1ddc7293dcb54e67dad5690c2a9e636c9e

Contents?: true

Size: 1.07 KB

Versions: 28

Compression:

Stored size: 1.07 KB

Contents

require "jsduck/tag/member_tag"

module JsDuck::Tag
  class CssVar < MemberTag
    def initialize
      @pattern = "var"
      @tagname = :css_var
      @member_type = {
        :title => "CSS Variables",
        :toolbar_title => "CSS Vars",
        :position => MEMBER_POS_CSS_VAR,
        :icon => File.dirname(__FILE__) + "/icons/css_var.png"
      }
    end

    # @var {Type} [name=default] ...
    def parse_doc(p, pos)
      p.standard_tag({
          :tagname => :css_var,
          :type => true,
          :name => true,
          :default => true,
          :optional => true
        })
    end

    def process_doc(h, tags, pos)
      p = tags[0]
      h[:name] = p[:name]
      h[:type] = p[:type]
      h[:default] = p[:default]
    end

    def process_code(code)
      h = super(code)
      h[:type] = code[:type]
      h[:default] = code[:default]
      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)
      member_link(var) + " : " + var[:html_type]
    end
  end
end

Version data entries

28 entries across 28 versions & 3 rubygems

Version Path
solvas-jsduck-6.0.0.30539 lib/jsduck/tag/css_var.rb
solvas-jsduck-6.0.0.9571 lib/jsduck/tag/css_var.rb
solvas-jsduck-6.0.0.6154 lib/jsduck/tag/css_var.rb
solvas-jsduck-6.0.0.4021 lib/jsduck/tag/css_var.rb
solvas-jsduck-6.0.0.2554 lib/jsduck/tag/css_var.rb
solvas-jsduck-6.0.0.1891 lib/jsduck/tag/css_var.rb
solvas-jsduck-6.0.0.beta.1888 lib/jsduck/tag/css_var.rb
jsduck-troopjs-0.0.10 lib/jsduck/tag/css_var.rb
jsduck-troopjs-0.0.9 lib/jsduck/tag/css_var.rb
jsduck-troopjs-0.0.8 lib/jsduck/tag/css_var.rb
jsduck-troopjs-0.0.7 lib/jsduck/tag/css_var.rb
jsduck-troopjs-0.0.5 lib/jsduck/tag/css_var.rb
jsduck-troopjs-0.0.4 lib/jsduck/tag/css_var.rb
jsduck-troopjs-0.0.3 lib/jsduck/tag/css_var.rb
jsduck-troopjs-0.0.1 lib/jsduck/tag/css_var.rb
jsduck-6.0.0beta lib/jsduck/tag/css_var.rb
jsduck-5.3.4 lib/jsduck/tag/css_var.rb
jsduck-5.3.3 lib/jsduck/tag/css_var.rb
jsduck-5.3.2 lib/jsduck/tag/css_var.rb
jsduck-5.3.1 lib/jsduck/tag/css_var.rb