LoginSignup
2
0

More than 3 years have passed since last update.

【Tips】Hamlでマークダウン記法のフィルターを使用するときのエラーへの対処

Last updated at Posted at 2019-09-17

問題

Hamlではマークダウン記法が使用可能であるがエラーにより変換できない場合がある。

入力

markdown.haml
!!!
%html
    %body
        :markdown
            --
shell
haml markdown.haml markdown.html

出力

shell
Haml error on line 324: "markdown" filter's pandoc-ruby dependency missing: try installing it or adding it to your Gemfile
  Use --trace for backtrace.

環境

  • Lubuntu 18.04LTS
    • anyenv
      • rbenv 1.1.1-39-g59785f6
        • ruby 2.4.5p335 (2018-10-18 revision 65137) [x86_64-linux]
          • gem 2.6.14.3
            • Haml 5.0.4

原因

Haml系ライブラリ(gem)の他に別途マークダウンを使うためのライブラリをインストールする必要がある。

解決方法

マークダウンを扱うライブラリのインストール。
エラーメッセージではpandoc-rubyを推奨されるが、今回はこのQ&Aに習いkramdownをインストールした。

入力

shell
gem install kramdown
haml markdown.haml markdown.html

出力

makdown.html
<!DOCTYPE html>
<html>
<body>
<ul>
  <li></li>
  <li></li>
</ul>
</body>
</html>

参考文献

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