I am trying to create a git hook which generates a readme.md file that contains an "index" in which only the .c files, as part of my class assignments, are linked. The directory tree looks like this
$ tree
├── assignment1
│ ├── linear_lists.c
| |── circular_lists.c
| |── main.c
├── assignment2
│ ├── stacks.c
│ ├── main.c
| ...
└── readme.md
So far I have only figured out how to generate the code for a single leveled list
* [assignment1/linear_lists.c](https://raw.githubusercontent.com/me/myrepo/main/assignment1/linear_lists.c)
* [assignment1/circular_lists.c](/https://raw.githubusercontent.com/me/myrepo/main/assignment1/circular_lists.c)
...
* [assignment2/stacks.c](https://raw.githubusercontent.com/me/myrepo/assignment2/stacks.c)
...
using :
find . -name "*.c" | sed "s|^\./\(.*\)|* \[\1\]($url/$repo/$branch/\1)|" >> readme.md
I want to represent the above as a two-level markdown list by basically generating the following code (using only Unix utilties if possible)
* assignment1 <!-- name of parent -->
+ [linear_lists.c](same link as above)
+ [circular_lists.c](same link as above)
...
* assignment2
+ [stacks.c](same link as above)
...
Is this possible ? Any help is appreciated.