Last active
August 29, 2015 14:10
-
-
Save vors/3bac89541222d77361d9 to your computer and use it in GitHub Desktop.
Converts markdown to plain text with https://github.com/vmg/redcarpet
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' | |
require 'redcarpet/render_strip' | |
# require 'redcarpet/render_man.rb' | |
# Get stdin as a string | |
input = STDIN.readlines.join("\n") | |
# Initializes a Markdown parser | |
markdown = Redcarpet::Markdown.new(Redcarpet::Render::ManPage) | |
# Render | |
output = markdown.render(input) | |
# Print output to stdout | |
puts output |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment