Created
June 10, 2017 18:59
-
-
Save BrentonEarl/3b38e8a8404dd2d56170ee502590dcef to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env ruby | |
require 'redcarpet' | |
md_file = File.read(ARGV.first) | |
html_filename = File.basename(ARGV.first, ".md") + ".html" | |
File.open(html_filename, 'w') do |file| | |
file.write(Redcarpet::Markdown.new(Redcarpet::Render::HTML.new).render(md_file)) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To use this on Slackware, run as root:
Then log out of the root account and run the script as a normal user with:
It will save the converted markdown text to an html formatted file within the same directory as the script.
"Markdown_file.md" will output "Markdown_file.html"