4
3

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 5 years have passed since last update.

QiitaのMarkDownでリストの順番を簡単に並べ替える方法

Posted at

小ネタです。

MarkDownで番号付きリストを使うと番号が自動で振られて便利ですが、あとで並べ替えるのが面倒。
と思い込んでましたがちゃんと考慮されていたのでメモ。

番号付きリスト
1. hoge
2. foo
3. bar

番号付きリストの記述方法(入れ替え簡単版)

MarkDown

ポイントは、 文頭の数字は連番でなくていいということ。

1. はじめに
1. そのつぎ
1. つぎのつぎ
1. まだ続く

または

1. はじめに
* そのつぎ
* つぎのつぎ
* まだ続く

文頭の数字は全部同じでも(違っても)勝手に連番になるから、1. 1. 1. などにしておくと直すのが楽!最初が 数字. なら次行以降は * などでもOK。連番でなくていいのです。

↓入れ替えがめんどくさい版MarkDown

1. はじめに
2. そのつぎ
3. つぎのつぎ
4. まだ続く

簡単版で書いたときの実際の表示

  1. はじめに
  2. そのつぎ
  3. つぎのつぎ
  4. まだ続く

Kobitoのチートシートより。これが罠でしたw

文頭に「数字.」を入れると順序つきリストになります
1.2.3.と入れていくといい具合です

オフィシャルサイトにものっていました。(http://qiita.com/Qiita/items/c686397e4a0f4f11683d#3-6)

4
3
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
4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?