Class: GitHub::Markup::RDoc

Inherits:
Object
  • Object
show all
Defined in:
lib/github/markup/rdoc.rb

Instance Method Summary collapse

Constructor Details

#initialize(content) ⇒ RDoc

Returns a new instance of RDoc.



7
8
9
# File 'lib/github/markup/rdoc.rb', line 7

def initialize(content)
  @content = content
end

Instance Method Details

#to_htmlObject



11
12
13
14
15
16
17
# File 'lib/github/markup/rdoc.rb', line 11

def to_html
  simple_markup = SM::SimpleMarkup.new
  generator = Generators::HyperlinkHtml.new(nil, OpenStruct.new)
  simple_markup.add_special(/((link:|https?:|mailto:|ftp:|www\.)\S+\w)/, :HYPERLINK)
  simple_markup.add_special(/(((\{.*?\})|\b\S+?)\[\S+?\.\S+?\])/, :TIDYLINK)
  simple_markup.convert(@content, generator)
end