Loading lib/jsduck/tag/author.rb +16 −2 Original line number Diff line number Diff line 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 end # @author Name of Author <email@example.com> ... # Everything until the end of line gets just ignored. def parse_doc(p) p.match(/.*$/) 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 lib/jsduck/tag/docauthor.rb +2 −0 Original line number Diff line number Diff line Loading @@ -4,7 +4,9 @@ module JsDuck::Tag # Exactly the same as @author tag - it's simply ignored. class Docauthor < Author def initialize super @pattern = "docauthor" @tagname = :docauthor end end end Loading
lib/jsduck/tag/author.rb +16 −2 Original line number Diff line number Diff line 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 end # @author Name of Author <email@example.com> ... # Everything until the end of line gets just ignored. def parse_doc(p) p.match(/.*$/) 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
lib/jsduck/tag/docauthor.rb +2 −0 Original line number Diff line number Diff line Loading @@ -4,7 +4,9 @@ module JsDuck::Tag # Exactly the same as @author tag - it's simply ignored. class Docauthor < Author def initialize super @pattern = "docauthor" @tagname = :docauthor end end end