Module: OodAppkit::MarkdownTemplateHandler
- Defined in:
- lib/ood_appkit/markdown_template_handler.rb
Overview
Class used to handle markdown views in ‘ActionView::Template`
Class Method Summary collapse
-
.call(_, source) ⇒ String
String of ruby code to be evaluated when rendering the view.
-
.render(text) ⇒ String
Render markdown to HTML.
Class Method Details
.call(_, source) ⇒ String
String of ruby code to be evaluated when rendering the view
7 8 9 |
# File 'lib/ood_appkit/markdown_template_handler.rb', line 7 def self.call(_, source) "begin;#{render(source)}.html_safe;end" end |
.render(text) ⇒ String
Render markdown to HTML
14 15 16 |
# File 'lib/ood_appkit/markdown_template_handler.rb', line 14 def self.render(text) markdown.render(text).inspect end |