module OodAppkit::MarkdownTemplateHandler
Class used to handle markdown views in ‘ActionView::Template`
Public Class Methods
Source
# File lib/ood_appkit/markdown_template_handler.rb, line 7 def self.call(_, source) "begin;#{render(source)}.html_safe;end" end
String of ruby code to be evaluated when rendering the view @param template [ActionView::Template] the template to be rendered @return [String] string of ruby code to be evaluated
Source
# File lib/ood_appkit/markdown_template_handler.rb, line 14 def self.render(text) markdown.render(text).inspect end
Render markdown to HTML @param text [String] markdown text @return [String] escaped version of html text surrounded by quote marks
Private Class Methods
Source
# File lib/ood_appkit/markdown_template_handler.rb, line 19 def self.markdown @markdown ||= OodAppkit.markdown end
Markdown renderer used