Generate TOC in README

and assert it is up to date
This commit is contained in:
Dan Buch
2016-06-16 11:47:19 -04:00
parent b7750a08e7
commit ee69d3c011
4 changed files with 50 additions and 4 deletions

View File

@@ -18,7 +18,8 @@ def main(sysargs=sys.argv[:]):
targets = {
'vet': _vet,
'test': _test,
'gfmxr': _gfmxr
'gfmxr': _gfmxr,
'toc': _toc,
}
parser = argparse.ArgumentParser()
@@ -62,6 +63,11 @@ def _vet():
_run('go vet ./...'.split())
def _toc():
_run(['node_modules/.bin/markdown-toc', '-i', 'README.md'])
_run(['git', 'diff', '--quiet'])
def _run(command):
print('runtests: {}'.format(' '.join(command)), file=sys.stderr)
check_call(command)