LoginSignup
1
2

More than 5 years have passed since last update.

Text::Markdown::DiscountでFenced code blocksを有効にする

Last updated at Posted at 2015-03-20

perlでMarkdownを変換する必要があったのでText::Markdown::Discount を使ってみました。
テーブルや定義リストなど、いくつかの拡張記法に対応しているので重宝しています。

ですが、普通にインストールするだけではGFMでサポートされているFanced code blocksPHP Markdown Extraスタイルの定義リストが利用できません。

Text::Markdown::Discountでこれらを利用するにはMakefile.PLを書き換えてdiscountのオプションを有効にする必要があります。
オプションを有効にしてインストールする手順は次のとおりです。

$ curl -L https://cpan.metacpan.org/authors/id/S/SE/SEKIMURA/Text-Markdown-Discount-0.11.tar.gz | tar xzf - 
$ cd Text-Markdown-Discount-0.11
$ sed -i.bak -e 's/sh configure.sh;/sh configure.sh --with-fenced-code --with-dl=Both;/' Makefile.PL
$ cpanm .

Text::Markdown::Discountを使うときには参考にしてみてください。

1
2
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
1
2