Pandocのインストール方法にCentOSが無かったのですがEPELにパッケージがありました。
とりあえずPandocを試してみたかったので今回はこのパッケージを利用しました。
Pandocのインストール
# EPELリポジトリを取得 wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm # EPELリポジトリをインストール rpm -ivh epel-release-6-8.noarch.rpm # Pandocパッケージがあることを確認 yum info pandoc # Pandocパッケージをインストール yum install pandocPandocでMarkdownファイルをHTMLファイルに変換
# Markdownファイルを作成 vi input.md # MarkdownファイルをHTMLファイルに変換 pandoc input.md -o input.htmlinput.mdの内容
# test ## テストinput.htmlの内容
<h1 id="test">test</h1> <h2 id="テスト">テスト</h2>入力ファイルの文字コードはutf-8で作成しましたが、日本語も表示されていました。
今回インストールしたPandocは約2年前のバージョン(リリースページ)になるので利用するときは
だいぶ前のバージョンということを考慮しといたほうが良いかもしれないです。
Pandocパッケージ情報
Name : pandoc Arch : x86_64 Version : 1.9.4.1 Release : 1.1.el6 Size : 1.1 M Repo : epel Summary : Markup conversion tool for markdown URL : http://hackage.haskell.org/package/pandoc License : GPLv2+ Description : Pandoc is a Haskell library for converting from one markup format to another, : and a command-line tool that uses this library. It can read markdown and : (subsets of) reStructuredText, HTML, and LaTeX, and it can write markdown, : reStructuredText, HTML, LaTeX, ConTeXt, Docbook, OpenDocument, ODT, RTF, : MediaWiki, groff man pages, EPUB, and S5 and Slidy HTML slide shows.