Redcarpet
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
&tag(Redcarpet);
*目次 [#xfb2296f]
#contents
*関連ページ [#k1d67c0b]
*参考情報 [#w0e430db]
-RubyのMarkdownライブラリ。
*使用方法 [#wfe3be11]
-Gemfileに追加
gem "redcarpet", "~> 2.3.0"
-bundle実行
bundle install --path=vendor/bundle
-ヘルパーの作成
-[[Railsでカスタムmarkdownを実装する - k0kubun's blog:htt...
#pre{{
module MarkdownHelper
def markdown(text)
unless @markdown
renderer = Redcarpet::Render::HTML.new
@markdown = Redcarpet::Markdown.new(renderer)
end
@markdown.render(text).html_safe
end
end
}}
-ビューから呼び出す
<%= markdown book.content %>
終了行:
&tag(Redcarpet);
*目次 [#xfb2296f]
#contents
*関連ページ [#k1d67c0b]
*参考情報 [#w0e430db]
-RubyのMarkdownライブラリ。
*使用方法 [#wfe3be11]
-Gemfileに追加
gem "redcarpet", "~> 2.3.0"
-bundle実行
bundle install --path=vendor/bundle
-ヘルパーの作成
-[[Railsでカスタムmarkdownを実装する - k0kubun's blog:htt...
#pre{{
module MarkdownHelper
def markdown(text)
unless @markdown
renderer = Redcarpet::Render::HTML.new
@markdown = Redcarpet::Markdown.new(renderer)
end
@markdown.render(text).html_safe
end
end
}}
-ビューから呼び出す
<%= markdown book.content %>
ページ名: