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.
205 206 207 |
# File 'lib/ruby_rich/markdown.rb', line 205 def initialize( = {}) @options = end |
Class Method Details
.render(markdown_text, options = {}) ⇒ Object
192 193 194 195 196 197 198 199 200 201 202 203 |
# File 'lib/ruby_rich/markdown.rb', line 192 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
209 210 211 |
# File 'lib/ruby_rich/markdown.rb', line 209 def render(markdown_text) self.class.render(markdown_text, @options) end |