Sha256: b5180c2b164c800435fff915a815ff848f67a7128a306a690ddb8af5cb53941a
Contents?: true
Size: 728 Bytes
Versions: 30
Compression:
Stored size: 728 Bytes
Contents
require "jsduck/tag/tag" require 'jsduck/format/shortener' module JsDuck::Tag # A special class for rendering the documentation field inside # classes and members. class Doc < Tag def initialize @tagname = :doc @html_position = POS_DOC @shortener = JsDuck::Format::Shortener.new end def format(m, formatter) m[:doc] = formatter.format(m[:doc]) if expandable?(m) || @shortener.too_long?(m[:doc]) m[:short_doc] = @shortener.shorten(m[:doc]) end end def to_html(m) m[:doc] end private def expandable?(m) m[:params] || (m[:properties] && m[:properties].length > 0) || m[:default] || m[:deprecated] || m[:template] end end end
Version data entries
30 entries across 30 versions & 3 rubygems