Class: Belajar::Markdown::RubyDoc

Inherits:
Object
  • Object
show all
Defined in:
lib/belajar/markdown/ruby_doc.rb

Constant Summary collapse

RUBY_DOC_URL =
'http://ruby-doc.org'.freeze
CORE_BASE_URL =
"#{RUBY_DOC_URL}/core-#{RUBY_VERSION}".freeze
STDLIB_BASE_URL =
"#{RUBY_DOC_URL}/stdlib-#{RUBY_VERSION}".freeze
CORE_REGEX =
/\(ruby-doc core:\s?(.*)\)/
STDLIB_REGEX =
/\(ruby-doc stdlib:\s?(.*)\)/

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.parse(text) ⇒ Object



14
15
16
# File 'lib/belajar/markdown/ruby_doc.rb', line 14

def parse(text)
  new.parse(text)
end

Instance Method Details

#parse(text) ⇒ Object



19
20
21
22
# File 'lib/belajar/markdown/ruby_doc.rb', line 19

def parse(text)
  parsed_text = sub_stdlib_links(text)
  sub_core_links(parsed_text)
end