Skip to content

Commit

Permalink
Merge pull request #68 from mamebro/use-github-markdown
Browse files Browse the repository at this point in the history
Use github markdown
  • Loading branch information
kurotaky committed Nov 25, 2013
2 parents 9b851a1 + f9ec886 commit 4dbaa31
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ gem 'haml'
gem 'faraday'
gem 'lazy_high_charts'
gem 'newrelic_rpm'
gem 'github-markdown'

# Gems used only for assets and not required
# in production environments by default.
Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ GEM
multipart-post (~> 1.1)
ffi (1.9.0)
formatador (0.2.4)
github-markdown (0.6.3)
google-analytics-rails (0.0.4)
growl (1.0.3)
guard (1.7.0)
Expand Down Expand Up @@ -232,6 +233,7 @@ DEPENDENCIES
factory_girl_rails
faker
faraday
github-markdown
google-analytics-rails
growl
guard-rspec
Expand Down
10 changes: 3 additions & 7 deletions app/models/entry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,10 @@ class Entry < ActiveRecord::Base
default_scope { order('created_at DESC') }
paginates_per 5

# https://github.com/rtomayko/rdiscount
# Markdownで出力する
# http://rubygems.org/gems/github-markdown
# GitHub-Markdownで出力
def content_as_markdown
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML,
autolink: true,
space_after_headers: true,
filter_html: true)
markdown.render(content)
GitHub::Markdown.render_gfm(content)
end

def self.from_brothers_followed_by(brother)
Expand Down

0 comments on commit 4dbaa31

Please sign in to comment.