Class: YARD::APIPlugin::Markup::RedcarpetDelegate
- Inherits:
-
Object
- Object
- YARD::APIPlugin::Markup::RedcarpetDelegate
- Defined in:
- lib/yard-api/markup/redcarpet.rb
Overview
TODO: make this configurable
Constant Summary collapse
- Extensions =
{ no_intra_emphasis: true, fenced_code_blocks: true, autolink: true, tables: true, lax_spacing: false, space_after_headers: true, underline: true, highlight: true, footnotes: true }.freeze
- RendererOptions =
{ }.freeze
Instance Method Summary collapse
-
#initialize(text, extensions_and_options = nil) ⇒ RedcarpetDelegate
constructor
A new instance of RedcarpetDelegate.
- #to_html ⇒ Object
Constructor Details
#initialize(text, extensions_and_options = nil) ⇒ RedcarpetDelegate
Returns a new instance of RedcarpetDelegate.
22 23 24 25 26 |
# File 'lib/yard-api/markup/redcarpet.rb', line 22 def initialize(text, =nil) @renderer = Redcarpet::Render::HTML.new(RendererOptions) @markdown = Redcarpet::Markdown.new(@renderer, Extensions) @text = text end |
Instance Method Details
#to_html ⇒ Object
28 29 30 |
# File 'lib/yard-api/markup/redcarpet.rb', line 28 def to_html @markdown.render(@text) end |