Permalink
Browse files

Use RDiscount for Markdown parsing

  • Loading branch information...
1 parent bf522a3 commit f5b24df7b7f761a495f0075a2a6f1eb7b7065b88 @leonardehrenfried committed Mar 6, 2012
Showing with 14 additions and 4 deletions.
  1. +1 −1 Gemfile
  2. +2 −2 Gemfile.lock
  3. +11 −1 generate_feed.rb
View
@@ -1,4 +1,4 @@
source 'http://rubygems.org'
gem "hpricot", "~> 0.8.6"
-gem "redcarpet", "~> 2.1.0"
+gem "rdiscount", "~> 1.6.8"
View
@@ -2,11 +2,11 @@ GEM
remote: http://rubygems.org/
specs:
hpricot (0.8.6)
- redcarpet (2.1.0)
+ rdiscount (1.6.8)
PLATFORMS
ruby
DEPENDENCIES
hpricot (~> 0.8.6)
- redcarpet (~> 2.1.0)
+ rdiscount (~> 1.6.8)
View
@@ -3,9 +3,19 @@
require 'rubygems'
require 'hpricot'
require 'open-uri'
+require 'rss/maker'
+require 'rdiscount'
+
+
doc = Hpricot(open("http://git-scm.com/"))
ver = doc.at("div#ver").inner_text
ver = ver[1..-1] #remove leading 'v'
-print ver
+url = "https://raw.github.com/gitster/git/master/Documentation/RelNotes/#{ver}.txt"
+release_notes = open(url){ |f| f.read }
+markdown = RDiscount.new(release_notes)
+html_notes = markdown.to_html
+
+puts html_notes
+

0 comments on commit f5b24df

Please sign in to comment.