LoginSignup
10
10

More than 5 years have passed since last update.

Markdown/HTMLの相互変換「Pandoc」

Posted at

HTMLでかかれたものをQiitaにあげるのに、Markdown形式に変換したくて調べていたところ、Pandocというツールがいい感じだったので、Pandocのインストールから簡単な使い方をまとめておきます。

インストール

私の場合、Ubuntuだとパッケージがあったので、apt-getでインストールします。

$ sudo apt-get install pandoc

HTML->Markdown変換

コマンドラインで、

$ pandoc -s test.html -o out.txt

また、直接サイトのHTMLを変換することもできます。

$ pandoc -s -r html http://www.gnu.org/software/make/ -o example.txt

おわりに

ちゃんと構造化されているようなHTMLだと期待通りの変換ができました。他にもLaTeXやmanなども相互変換できるようです。

10
10
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
10
10