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

Version Path
jinda-0.5.3 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-0.5.2 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-0.5.1 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-0.5.0 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-0.4.9 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-0.4.8 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-0.4.7 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-0.4.6 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-5-0.4.5 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-0.4.5 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-0.4.4 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-0.4.3 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-0.4.2 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-0.4.1 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-0.4.0 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-0.3.9 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-0.3.8 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-0.3.7 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-0.3.6 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-0.3.5 lib/generators/jinda/templates/app/helpers/application_helper.rb