Add 'make toc' to re-generate the TOC in the README (see #429)

This commit is contained in:
Trent Mick 2016-08-26 09:30:26 -07:00
parent 61f8af9b5c
commit 604ff1e88b
2 changed files with 7 additions and 1 deletions

View file

@ -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("</body>", """<a href="https://github.com/trentm/node-bunyan"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a></body>"""); 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

View file

@ -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"
},