Sha256: 4ea5d258981ff9aceab3f158862170ab5b6157107dad7c2e8fb92969f2c8dd93

Contents?: true

Size: 707 Bytes

Versions: 29

Compression:

Stored size: 707 Bytes

Contents

require "jsduck/tag/tag"

module JsDuck::Tag
  # Author tag gets processed, but no output gets created.  Users of
  # JSDuck may override this tag to make it print the names of
  # authors.
  class Author < Tag
    def initialize
      @pattern = "author"
      @tagname = :author
      @repeatable = true
    end

    # @author Name of Author <email@example.com> ...
    def parse_doc(p, pos)
      name = p.match(/[^<\n]*/).strip
      if p.look(/</)
        p.match(/</)
        email = p.match(/[^>\n]*/)
        p.match(/>/)
      end

      return {:tagname => @tagname, :name => name, :email => email}
    end

    def process_doc(context, tags, pos)
      context[@tagname] = tags
    end
  end
end

Version data entries

29 entries across 29 versions & 3 rubygems

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