# Custom tags for JSDuck 5.x # See also: # - https://github.com/senchalabs/jsduck/wiki/Tags # - https://github.com/senchalabs/jsduck/wiki/Custom-tags # - https://github.com/senchalabs/jsduck/wiki/Custom-tags/7f5c32e568eab9edc8e3365e935bcb836cb11f1d require 'jsduck/tag/tag' class CommonTag < JsDuck::Tag::Tag def initialize @html_position = POS_DOC + 0.1 @repeatable = true end def parse_doc(scanner, _position) if @multiline return { tagname: @tagname, doc: :multiline } else text = scanner.match(/.*$/) return { tagname: @tagname, doc: text } end end def process_doc(context, tags, _position) context[@tagname] = tags end def format(context, formatter) context[@tagname].each do |tag| tag[:doc] = formatter.format(tag[:doc]) end end end class SeeTag < CommonTag def initialize @tagname = :see @pattern = 'see' super end def format(context, formatter) position = context[:files][0] context[@tagname].each do |tag| tag[:doc] = '