Sha256: 5943653928291437d33974bfcc4eb527116aeaf86e53bdd6ac4228324525ea8e
Contents?: true
Size: 760 Bytes
Versions: 90
Compression:
Stored size: 760 Bytes
Contents
module ApplicationHelper def title(blog_title) content_for(:title) { blog_title } end def meta_description(blog_text) content_for(:meta_description) { blog_text } end require 'redcarpet' require 'rouge' require 'rouge/plugins/redcarpet' class CodeRayify < Redcarpet::Render::HTML def block_code(code, language) CodeRay.scan(code, language).div end end def markdown(text) coderayified = CodeRayify.new(:filter_html => true, :hard_wrap => true) options = { :fenced_code_blocks => true, :no_intra_emphasis => true, :autolink => true, :lax_html_blocks => true, } markdown_to_html = Redcarpet::Markdown.new(coderayified, options) markdown_to_html.render(text).html_safe end end
Version data entries
90 entries across 87 versions & 5 rubygems