LoginSignup
12
13

More than 5 years have passed since last update.

redcarpetでMarkdownをHTML化

Last updated at Posted at 2013-06-21

RubyのredcarpetでMarkdownをHTML化したのでメモ。

redcarpetをインストール

gem install redcarpet

コード

markdown2html.rb
require 'redcarpet'

markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML)

puts markdown.render($stdin.read)

コマンドラインで作成

ruby markdown2html.rb < markdown.md > index.html

参考サイト

12
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
13