Class: YARD::Templates::Helpers::Markup::RDocMarkup

Inherits:
Object
  • Object
show all
Defined in:
lib/yard/templates/helpers/markup/rdoc_markup.rb

Constant Summary collapse

@@formatter =
nil
@@markup =
nil
@@mutex =
nil

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text) ⇒ RDocMarkup

Returns a new instance of RDocMarkup.



37
38
39
40
41
42
43
# File 'lib/yard/templates/helpers/markup/rdoc_markup.rb', line 37

def initialize(text)
  @text = text

  @@formatter ||= RDocMarkupToHtml.new
  @@markup ||= MARKUP.new
  @@mutex ||= Mutex.new
end

Instance Attribute Details

#from_pathObject

Returns the value of attribute from_path.



31
32
33
# File 'lib/yard/templates/helpers/markup/rdoc_markup.rb', line 31

def from_path
  @from_path
end

Instance Method Details

#to_htmlObject



45
46
47
48
49
50
51
52
53
54
# File 'lib/yard/templates/helpers/markup/rdoc_markup.rb', line 45

def to_html
  html = nil
  @@mutex.synchronize do
    @@formatter.from_path = from_path
    html = @@markup.convert(@text, @@formatter)
  end
  html = fix_dash_dash(html)
  html = fix_typewriter(html)
  html
end