Created
March 1, 2015 09:26
-
-
Save dalibor/892d907bf6b82284603c to your computer and use it in GitHub Desktop.
Github flavored markdown to HTML
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'bundler/setup' | |
require 'github/markup' | |
require 'html/pipeline' | |
file = ARGV[0] | |
abort("#{file} does not exist.") unless File.exists?(file) | |
html = GitHub::Markup.render(file) | |
pipeline = HTML::Pipeline.new [ | |
HTML::Pipeline::MarkdownFilter, | |
HTML::Pipeline::SyntaxHighlightFilter | |
] | |
puts pipeline.call(html)[:output].to_s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
gem 'github-markup' | |
gem 'github-markdown' | |
gem 'github-linguist' | |
gem 'html-pipeline' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment