joshrotenberg / adrs

Architectural Decision Record tool in Rust
http://joshrotenberg.com/adrs/
Apache License 2.0
19 stars 5 forks source link

Add '--ordered option' to toc generation #34

Closed lbenezriravin closed 4 months ago

lbenezriravin commented 4 months ago

Functionally backwards compatible. Moves the regex crate from dev-dependencies into the main dependencies.

In many (probably most) cases, the Table of Contents generated will look like this:

* [1. foo](0001-foo.md)
* [2. bar](0002-bar.md)
* [3. baz](0003-baz.md)

In my opinion this is ugly markdown, since it generates an unordered list and adds unsyntactic ordering after the fact. When rendered, it will look a lot like an ordered list, but with useless bullets in front of each item.

This patch adds a flag to leverage the common title structure generated by adrs to create a cleanly ordered list:

1. [foo](0001-foo.md)
1. [bar](0002-bar.md)
1. [baz](0003-baz.md)

Without the flag, output is unchanged. A few notes on error catching:

lbenezriravin commented 4 months ago

Hi @joshrotenberg , thanks for maintaining this tool! I made a patch to fix a minor nit that I had with the output of most adr tools I've come across. Please let me know if this is a feature you're open to and/or if you have any suggestions for improvements.

joshrotenberg commented 4 months ago

Hi @joshrotenberg , thanks for maintaining this tool! I made a patch to fix a minor nit that I had with the output of most adr tools I've come across. Please let me know if this is a feature you're open to and/or if you have any suggestions for improvements.

Thanks for this! I'll take a closer look later today, but I'm definitely open to this (and other) new features if you have more ideas.