Class: JsDuck::Tag::Author

Inherits:
Tag
  • Object
show all
Defined in:
lib/jsduck/tag/author.rb

Overview

Author tag gets processed, but no output gets created. Users of JSDuck may override this tag to make it print the names of authors.

Direct Known Subclasses

Docauthor

Constant Summary

Constants inherited from Tag

Tag::POS_ASIDE, Tag::POS_DEFAULT, Tag::POS_DEPRECATED, Tag::POS_DOC, Tag::POS_ENUM, Tag::POS_FIRES, Tag::POS_LOCALDOC, Tag::POS_OVERRIDES, Tag::POS_PARAM, Tag::POS_PREVENTABLE, Tag::POS_PRIVATE, Tag::POS_RETURN, Tag::POS_SINCE, Tag::POS_SUBPROPERTIES, Tag::POS_TEMPLATE, Tag::POS_THROWS, Tag::PRIORITY_CLASS, Tag::PRIORITY_COMPONENT, Tag::PRIORITY_SINGLETON

Instance Attribute Summary

Attributes inherited from Tag

#class_icon, #css, #ext_define_default, #ext_define_pattern, #html_position, #pattern, #repeatable, #signature, #tagname

Instance Method Summary collapse

Methods inherited from Tag

descendants, #format, #parse_ext_define, #to_html

Constructor Details

#initializeAuthor

Returns a new instance of Author.



8
9
10
11
12
# File 'lib/jsduck/tag/author.rb', line 8

def initialize
  @pattern = "author"
  @tagname = :author
  @repeatable = true
end

Instance Method Details

#parse_doc(p, pos) ⇒ Object

Author:



15
16
17
18
19
20
21
22
23
24
# File 'lib/jsduck/tag/author.rb', line 15

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

#process_doc(context, tags, pos) ⇒ Object



26
27
28
# File 'lib/jsduck/tag/author.rb', line 26

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