Created
May 22, 2012 03:52
-
-
Save kachick/2766455 to your computer and use it in GitHub Desktop.
Simple Markdown Converter
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
| $VERBOSE = true | |
| require 'kramdown' | |
| HTML_HEADER = '<head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
| <link href="markdown.css" rel="stylesheet"></link> | |
| </head>'.freeze | |
| abort 'usage: this.rb doc1.md [doc2.md ...docN.md]' unless ARGV.length >= 1 | |
| ARGV.each do |path| | |
| open "#{path}.html", 'w:UTF-8' do |html| | |
| html.puts HTML_HEADER | |
| html << Kramdown::Document.new(File.read path).to_html | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment