0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【Ruby on Rails】redcarpetを使ったMarkdown記法の拡張機能のまとめ

Posted at

対象者

  • マークダウンを実装予定の方
  • gem redcarpetを使う予定の方

目的

  • redcarpetの拡張機能を一つひとつ理解しながら使用する

実際の手順と実例

1.gemの導入

Gemfile

:
gem redcarpet
:

bundle installを実行

2.拡張機能一覧

機能 説明
:no_intra_emphasis 単語の強調。**や--で囲う
:fenced_code_blocks フェンスで囲まれたコードブロックを解析します。3つ以上の~バックティックで区切られたブロックは、インデントする必要なしにコードと見なされます。オプションの言語名は、コードブロックの開始フェンスの最後に追加できます。
:autolink リンクを解析します。http、https、およびftpプロトコルの自動リンクは自動的に検出されます
:disable_indented_code_blocks 各行の前に4つのスペースがあるテキストをコードブロックに変換します。
:strikethrough 打ち消し線を使います。〜文字〜と入力すると打ち消しされます
:space_after_headers 見出しを作ります。#の数でh1〜h6まで分かれます。#の後に半角スペースが必要

※随時更新

参照

red carpet 公式Github

投稿者コメント

PFにマークダウンを実装したので、拡張機能をまとめました。関連記事として、マークダウン自体の実装方法も記事にする予定です。

My Profile

プログラミング学習歴4ヶ月目のアカウントです!
プログラミングスクールで学んだ内容や
自分が躓いた箇所等のアウトプットの為に発信しています。
もし、投稿した記事の中に誤り等ございましたら、
コメント欄でご教授いただけると幸いです。 

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?