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

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

Direct Known Subclasses

RDocMarkdown

Constant Summary collapse

@@mutex =
Mutex.new
@@formatter =
nil
@@markup =
nil

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text) ⇒ RDocMarkup


41
42
43
44
45
46
47
48
# File 'lib/yard/templates/helpers/markup/rdoc_markup.rb', line 41

def initialize(text)
  @text = text

  @@mutex.synchronize do
    @@formatter ||= RDocMarkupToHtml.new
    @@markup ||= MARKUP.new
  end
end

Instance Attribute Details

#from_pathObject

Returns the value of attribute from_path


35
36
37
# File 'lib/yard/templates/helpers/markup/rdoc_markup.rb', line 35

def from_path
  @from_path
end

Instance Method Details

#to_htmlObject


50
51
52
53
54
55
56
57
58
59
# File 'lib/yard/templates/helpers/markup/rdoc_markup.rb', line 50

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