diff --git a/Makefile b/Makefile index 3c6ea9a..6b4e85d 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,7 @@ cutarelease: versioncheck check ./tools/cutarelease.py -p bunyan -f package.json -f lib/bunyan.js -f bin/bunyan .PHONY: docs -docs: +docs: toc @[[ `which ronn` ]] || (echo "No 'ronn' on your PATH. Install with 'gem install ronn'" && exit 2) mkdir -p man/man1 ronn --style=toc --manual="bunyan manual" --date=$(shell git log -1 --pretty=format:%cd --date=short) --roff --html docs/bunyan.1.ronn @@ -54,6 +54,11 @@ docs: python -c 'import sys; h = open("docs/bunyan.1.html").read(); h = h.replace("", """Fork me on GitHub"""); open("docs/bunyan.1.html", "w").write(h)' @echo "# test with 'man ./docs/bunyan.1' and 'open ./docs/bunyan.1.html'" +# Re-generate the README.md table of contents. +toc: + ./node_modules/.bin/markdown-toc -i README.md + + .PHONY: publish publish: mkdir -p tmp diff --git a/package.json b/package.json index 5c26d0f..a0963c9 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "devDependencies": { "nodeunit": "0.9", "ben": "0.0.0", + "markdown-toc": "0.12.x", "verror": "1.3.3", "vasync": "1.4.3" },