LoginSignup
4
4

More than 5 years have passed since last update.

doctocを使ってreadmeに目次を作成する

Posted at

thlorenz/doctoc: 📜 Generates table of contents for markdown files inside local git repository. Links are compatible with anchors generated by github or other sites.

doctocはreadmeに目次を作れる。
ドキュメントに目次があれば、readmeの移動が楽になる。

デフォルトだと、titleがデカデカで出てしまうので、--notitleを付けるとよい。

$ npx doctoc --maxlevel 3 --notitle readme.md

npxで一気に使っていいが、継続して更新していくつもりなら、huskylint-stagedを使ってコミット時に走らすのがいいだろう。

参考

自分のOSSのプロジェクトに導入した結果が下のような感じ。

スクリーンショット 2018-02-05 21.09.06.png

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