Class: RubyRich::Markdown
- Inherits:
-
Object
- Object
- RubyRich::Markdown
- Defined in:
- lib/ruby_rich/markdown.rb
Defined Under Namespace
Classes: TerminalRenderer
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Markdown
constructor
A new instance of Markdown.
- #render(markdown_text) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Markdown
Returns a new instance of Markdown.
335 336 337 |
# File 'lib/ruby_rich/markdown.rb', line 335 def initialize( = {}) = end |
Class Method Details
.render(markdown_text, options = {}) ⇒ Object
322 323 324 325 326 327 328 329 330 331 332 333 |
# File 'lib/ruby_rich/markdown.rb', line 322 def self.render(markdown_text, = {}) renderer = TerminalRenderer.new() markdown_processor = Redcarpet::Markdown.new(renderer, { fenced_code_blocks: true, tables: true, autolink: true, strikethrough: true, space_after_headers: true }) markdown_processor.render(markdown_text) end |
Instance Method Details
#render(markdown_text) ⇒ Object
339 340 341 |
# File 'lib/ruby_rich/markdown.rb', line 339 def render(markdown_text) self.class.render(markdown_text, ) end |