npryce / adr-tools

Command-line tools for working with Architecture Decision Records
Other
4.56k stars 578 forks source link

Generate an index.md #76

Closed thomvaill closed 5 years ago

thomvaill commented 5 years ago

I understand that adr generate toc outputs its content to stdout for deployment scriptability. But on the other hand, I like adr-log's -i parameter which generates directly the index.md file.

I propose to create a new command: adr generate index which accepts the same parameters as adr generate toc. This command would call _adr_generate_toc and _adr_dir to create an index.md directly in the adr directory.

For small projects, when you don't want to setup deployment scripts for your doc, I think it simplifies the process:

adr new ...
adr generate index
git commit

versus:

adr new ...
adr generate toc > docs/adr/index.md
git commit

Eventually, you can add adr generate index to a pre-commit hook ;)

If you are OK with this issue, I can work on a pull request.

npryce commented 5 years ago

ADR-Tools does not store derived files into the source directory.

If you want this behaviour for your project, then I recommend you write a helper script and commit it to your project’s repo.