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.8.0 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-0.8.0 test/dummy/app/helpers/application_helper.rb
jinda-0.7.7.4 test/dummy/app/helpers/application_helper.rb
jinda-0.7.7.4 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-0.7.7.3 test/dummy/app/helpers/application_helper.rb
jinda-0.7.7.3 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-0.7.7.2 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-0.7.7.1 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda_mind-1.0.0 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-0.7.7 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-0.7.6 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-0.7.5.5 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-0.7.5.4 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-0.7.5.3 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-0.7.5.2 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-0.7.5.0 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-0.7.3 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-0.7.2 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-0.7.1 lib/generators/jinda/templates/app/helpers/application_helper.rb
jinda-0.7.0.4 lib/generators/jinda/templates/app/helpers/application_helper.rb