Skip to content

Instantly share code, notes, and snippets.

@metacritical
Forked from dalibor/Gemfile
Last active September 10, 2015 06:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save metacritical/49ae32edbeb8e2327815 to your computer and use it in GitHub Desktop.
Save metacritical/49ae32edbeb8e2327815 to your computer and use it in GitHub Desktop.
Github flavored markdown to HTML
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
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